Commit graph

93 commits

Author SHA1 Message Date
sportshead
2b6f694b48 output: add extraPackagesAfter option
Some checks are pending
Build and deploy documentation / deploy (push) Waiting to run
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Allow users to add packages to the end of `PATH` in the neovim wrapper.
This is useful for LSP versions that might need to be overriden based on
the environment, e.g. `haskell-language-server` versions provided by a
project's devshell.
2025-06-08 22:14:58 +00:00
Stanislav Asunkin
65d35db5ca modules/performance: fix specifying combinePlugin.standalonePlugins as packages when byte compilation enabled
Previously, specifying plugins as packages in the
`performance.combinePlugins.standalonePlugins` option did not work when
the `performance.byteCompileLua` option was also enabled. This issue was
due to several package transformations performed by the
`byteCompileLua` which broke package comparison.

There are at least three methods to fix the issue:

- Change transformation order: combine plugins first, then byte-compile
  them.
- Compare every possible transformation when determining if plugins are
  standalone.
- Get the name of the package and use it for comparison.

The first method did not work because the current `byteCompileLuaDrv`
implementation does not support symlinks to directories. The second
method appears too fragile. This commit implements the third method, as
it requires minimal code changes and is straightforward. The downside is
that it might exclude multiple packages with the same name, although
this should be rare.
2025-06-02 18:15:32 +03:00
Stanislav Asunkin
4c23fb2738 tests/modules/performance/combine-plugins: use shared stub plugins
This commit replaces stub plugins with the shared ones from utils
module.
This also removes separate tests for checking python and lua
dependencies. This is now tested in the 'default' test thanks to
`pluginChecks` code.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
a49b270861 tests/modules/performance/byte-compile-lua: use shared stub plugins
This commit finalizes using shared utils stub plugins for
performance.byteCompileLua tests.
To re-use more code from utils module, 'pluginChecksFor', 'libChecksFor'
and 'pythonChecksFor' functions were introduced. These functions
generate a check code for the given plugins/libs names.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
75f2c1b1f1 modules/performance: ensure dependencies of lua packages also compiled
Previously only extraLuaPackages themselves were byte-compiled, not
theirs dependencies. This commit fixes that by compiling lua packages
recursively. It uses byte-compile-lua-lib.nix shared file.
Also this commit uses the shared stub lua libraries for extraLuaPackages
byte-compiling test.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
9474ce916a modules/performance: ensure all lua dependencies are byte-compiled
This commit replaces custom lua plugins in tests with shared stub
plugins from utils module.
After this change the test has started to fail. Debugging this issue
I found out that dependencies of plugins weren't processed.
This commit improves the test assertion to detect duplicated
dependencies in this case and fixes the underlying issue by also
processing dependencies.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
2c6182351f modules/performance: add ability to byte-compile plugin lua dependencies
This commit adds byte compiling of plugin lua dependencies
(specifically propagatedBuildInputs). It's enabled by
`performance.byteCompileLua.luaLib` option.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
404e56066f modules/performance: add ability to byte compile extraLuaPackages
This commit adds `performance.byteCompileLua.luaLib` options. When
enabled it byte-compiles lua packages from extraLuaPackages option.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
fac192c022 tests/modules/performance/byte-compile-lua: improve tests
* improve assert messages
* validate both byte-compiled and non-byte-compiled files are working
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
d7475dd0fa tests/modules/performance/byte-compile-lua: test with stub plugins
To reduce unexpected breakages due to changes in nixpkgs, replace the
tested plugins with specially crafted stub plugins.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
5b47c65705 tests/modules/performance/byte-compile-lua: improve bytecode detection
Previously, to determine if a file is byte-compiled, a simple binary
file detection was used, specifically checking if it contained any null
bytes. This commit updates the check to read the file header and compare
it with a known LuaJIT header.
2025-05-12 17:39:01 +03:00
Austin Horstman
5fed6b9363 plugins/claude-code: don't test on darwin
Currently failing on our CI, for some reason.
2025-05-08 10:51:26 +02:00
Matt Sturgeon
a072e3c3a7
modules/lsp: enable servers."*" by default 2025-05-01 00:36:41 +01:00
Johan Larsson
eeae362038
modules/lsp: add enable = true to wildcard config section 2025-04-30 20:55:26 +01:00
Matt Sturgeon
1df98b6636
modules/diagnostic: rename diagnostic.config -> diagnostic.settings
Follow up to #3226, in line with the decisions made in #3254.
2025-04-30 18:31:17 +01:00
Matt Sturgeon
21688b1d2a
modules/lsp/server: rename config -> settings
`config` is a loaded term within modules and options.

`settings` is the name usually used for freeform config in nixvim and
most other module configurations.
2025-04-30 17:35:46 +01:00
Gaetan Lepage
70c9b3b890 modules/lsp: init
Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-04-28 18:11:39 +02:00
Stanislav Asunkin
6415ae4a97 tests/modules/performance/combine-plugins: improve assertion messages
This commit eliminates assertions boilerplate and improves assertion
message by returning the number of plugins and their names.
2025-04-28 17:26:13 +03:00
Stanislav Asunkin
f28d384ab5 modules/performance/combine-plugins: propagate lua dependencies
Plugins from luarocks (e.g. telescope-nvim) have dependencies specified
in propagatedBuildInputs. These dependencies are not added as plugins in
Nvim runtime. They are added to LUA_PATH env var for wrapped neovim.
This commit collects all propagatedBuildInputs from input plugin list
and puts them in the combined plugin.
Note that such dependencies are never combined, because they are not
plugins.
2025-04-28 17:26:13 +03:00
Stanislav Asunkin
57e19ec3ec tests/modules/performance/combine-plugins: use stub plugins for tests
During the last half of the year many dependencies of plugins used in
the tests were changed in nixpkgs. To make tests more robust use a
specially crafted stub plugins.
2025-04-28 17:26:13 +03:00
Stanislav Asunkin
9c39ea4ccb tests/modules/performance/byte-compile-lua: fix tests
telescope-nvim doesn't have explicit dependency on plenary-nvim anymore.
Use noice-nvim which have a dependency on nui-nvim instead.
2025-04-28 17:26:13 +03:00
Stanislav Asunkin
014b143f6a tests/modules/performance/combine-plugins: restore test functionality
Replace test plugins to those that reflect the intention for the test.
2025-04-28 17:26:13 +03:00
Stanislav Asunkin
faa31d994c Revert "tests/modules-performance: add nvim-cmp to extraPlugins when necessary"
This reverts commit bb5b0a2655.

This change defeats the purpose of the dependency test. Revert it.
The test should verify that dependencies are correctly pulled. If
upstream plugin doesn't have dependency anymore, then a suitable
alternative should be used, not dependencies added manually.
2025-04-28 17:26:13 +03:00
Gaetan Lepage
89c94d9ea7 plugins/telescope/media-files: use the top-level dependencies option 2025-04-27 11:28:18 +02:00
Matt Sturgeon
6c73350557
modules/diagnostic: rename diagnostics -> diagnostic.config
Currently we represent `vim.diagnostic.config()` as a top-level
`diagnostics` option. This means we have no clear namespace for
(e.g.) `vim.diagnostic.<action>` keymap functions.
2025-04-26 20:09:23 +01:00
Wyatt Avilla
d86fe3df56
modules/diagnostics: fix virtual_lines example
The setting is named `current_line`, not `only_current_line`.

See https://neovim.io/doc/user/diagnostic.html#vim.diagnostic.Opts.VirtualLines
2025-04-24 16:50:32 -07:00
Gaetan Lepage
991f3c8709 treewide: re-enable godot tests 2025-04-24 12:48:41 +02:00
Gaetan Lepage
9eb03ab777 treewide: disable godot (build failure) 2025-04-22 12:16:02 +00:00
Gaetan Lepage
7a58109958 tests/dependencies: extend the disabled logic to the "examples" test case 2025-04-21 16:08:11 +02:00
Gaetan Lepage
91073486b2 tests/dependencies: add disabled list to skip testing broken dependencies 2025-04-21 13:55:36 +02:00
Matt Sturgeon
d94956e5da
lib/deprecation: implement aliases for mkRemovedPackageOptionModule
Allows most existing configs to continue building, now with warnings
instead of assertions when the old `plugins.*.*Package` options are
used.

An assertion will still occur if there is a merge conflict, e.g:
`plugins.a.fooPackage = null` and `plugins.b.fooPackage = pkgs.foo`.
2025-04-15 22:15:18 +01:00
Matt Sturgeon
16879e3034
modules/dependencies: refactor all-examples test
Embed the original `path` as an attr in the literal expression, so that
we don't need to convert back from human readable paths in the test.
2025-04-13 18:23:06 +01:00
Gaetan Lepage
72ce6dbdf5 tests/modules/dependencies: test all package examples 2025-04-12 00:37:55 +10:00
Gaetan Lepage
cfd4b61262 modules/dependencies: init + add curl 2025-04-11 08:51:45 +10:00
Gaetan Lepage
77c5fe808a modules/lua-loader: use new 0.11 API for enabling/disabling 2025-04-01 16:03:03 +02:00
Gaetan Lepage
95573411bc modules/keymaps: add replace_keycodes keymap sub-option 2025-03-28 11:32:49 +01:00
Matt Sturgeon
00586f8f1b
modules/output: move symlinkJoin to build.package 2025-01-20 14:49:59 +00:00
Matt Sturgeon
5b068e7f8f
tests/nixpkgs: move nixpkgs module test to dedicated drv
This should be separate from `test-sources` because we want to re-use a
common instance of nixpkgs throughout those tests.

Also, moved the existing nixpkgs module test from `test-sources`.

This partially reverts commit c4ad4d0b2e.
2025-01-15 18:04:06 +00:00
Gaetan Lepage
bb5b0a2655 tests/modules-performance: add nvim-cmp to extraPlugins when necessary 2024-11-30 18:13:15 +01:00
Heitor Augusto
1d78aee791 tests/modules/clipboard: add raw lua code test 2024-11-15 18:40:10 +00:00
Heitor Augusto
f11a877bcc
tests/modules/output: add tests for providers 2024-11-13 16:55:33 -03:00
Matt Sturgeon
c4ad4d0b2e
modules/nixpkgs: add overlays option
Based on the `nixpkgs.overlays` option available in NixOS, allows users
to further customize the `pkgs` instance used when evaluating nixvim.

The standard module tests are now provided a few extra module args to
enable a test where we instantiate a custom nixpkgs instance.
2024-10-19 21:11:42 +01:00
Stanislav Asunkin
767eb62f48 modules/output: obtain plugin configs from wrapped neovim
The official method for obtaining the generated initRc content is from
wrapped neovim rather than from makeNeovimConfig helper. To use this
approach: first wrap neovim with the generated config, then override it
with our wrapperArgs.
2024-10-13 09:54:05 +03:00
Stanislav Asunkin
21f7ed6eb6 tests/modules/output: test that init.lua contains all config sections
This test was removed in 3d1224a039 to
remove IFD. Rewrite the test using `pkgs.runCommandLocal` and grep.
2024-10-13 09:28:12 +03:00
Austin Horstman
75ae10571d
tests/byte-compile-lua: server_configurations -> configs
bedb2a0df1
2024-10-10 08:58:59 -05:00
Matt Sturgeon
6a1bf6bdc3
modules/output: check warnings+assertions on build.package
Add a `build.packageUnchecked` option for use instead of the old `check`
evalNixvim argument.
2024-09-26 18:04:36 +01:00
Matt Sturgeon
692e39311e
modules/{output,files,test}: move outputs to build scope
Move the following output options into `build`:
- finalPackage -> package
- printInitPackage
- initPath -> initFile
- filesPlugin -> extraFiles
- test.derivation -> test
2024-09-26 06:31:57 +01:00
Matt Sturgeon
4e5bd1d79b
lib: segregate and deprecate functions that need pkgs
Splits everything that depends on a `pkgs` instance into an optional
attrs, allowing `helpers.nix` to be bootstrapped without `pkgs`.

This required some refactoring:
- `modules.specialArgs` is only available when `pkgs` is used
- `modules.specialArgsWith` now requires `defaultPkgs` be provided
- `builders.*` now have `*With` variants that take `pkgs` as an argument
  and a `withPkgs` function that returns the old interface
- Had to define the fixed part of `builders` outside the attrs for now,
  to avoid infinite recursion.
- The old `builders` are now deprecated, and print a warning when
  evaluated
- `withOptoinalFns` was introduced to merge the optional attrs into the
  final lib.
2024-09-13 19:05:26 +01:00
Matt Sturgeon
123a55ed6f
tests: remove special treatment of module
Since we no longer need to extract `tests.dontRun` from an attrset, we
no longer need the "special" `module` attr.
2024-08-20 01:07:21 +01:00
Austin Horstman
00f32f0430
tests/lua-loader: builtins.match -> lib.hasInfix
Getting invalid regex expression on darwin.
2024-08-16 08:55:38 -05:00