Defining `extraFiles.*` as a string was deprecated in 24.05, and has
printed a warning since 2024-07-07.
We can now drop support entirely and simplify the implementation.
Currently, `types.either` has support for the new valueMeta attribute
added by v2 check and merge, while `types.nullOr` does not.
The `lua` option deprecation warning implemented in
`modules/keymaps.nix` requires `valueMeta`, so re-implement `nullOr`
using `types.either` as a workaround.
The deprecation warning for the keymap-submocule `lua` option relied on
`getSubOptions`, however this is fundamentally flawed because that
function returns uses a different module eval from the one that merges
submodule definitions.
Since definitions are not used by `getSubOptions`,
`options.lua.isDefined` will never be true.
Instead, we have two choices:
1. Add a `luaIsDefined` option to the keymap submodule
2. Use the new v2 merge's `valueMeta` to access the actual module eval
Simplify the `enableExceptInTests` attribute, removing the
`_nixvimTests` argument.
We now do a full re-eval of the nixvim configuration before building the
test, giving us a central place to implement `enableExceptInTests` and
its eventual replacement(s).
This extends support for `enableExceptInTests` to all methods of getting
a nixvim test derivation. Previously, it only worked when using `mkTestDerivationFromNixvimModule`.
In `tests/main.nix`, we avoid the re-eval by doing the initial eval with
a "test mode" lib from the start.
Instead of explicitly listing all renames and removals, we can check if
the plugin's lazyload option is visible and in the top-level option set.
This rules out cases where `plugins.foo` is itself a rename/removal
option, and cases where `plugins.foo.lazyload` is not visible.
Adds two internal per-server options: `packages.prefix` & `packages.suffix`.
These options allow the server module to install multiple packages, and
control which end up being prefixed or suffixed on the PATH.
This simplifies the propagating code in `modules/lsp/servers/default.nix`,
which can now zip up the enabled server `packages` attrs.
Adding a module in the following places will import the module into that
specific server's submodule.
This allows creating server-specific options.
Added a test case to ensure all custom modules correspond to an actual
server option to avoid accidental dead code.
`shorthandOnlyDefinesConfig` is true by default for `lib.types.submodule`,
and false by default for `lib.types.submoduleWith` and `lib.evalModules`.
Since we rely on it for our `lsp.servers.*.config` option, let's enable
it explicitly.
The `lsp.servers.<name>` option description links to the server's
homepage if it can evaluate the default package's `meta.homepage`.
However, users may evaluate this description, e.g. when building NixOS
docs with `documentation.nixos.includeAllModules`. Further, users may
have a different nixpkgs revisions to ours. Therefore, we need to allow
for the package not being in nixpkgs.
Since `mkPackageOption` will throw in the default, we can catch it with
`tryEval`.
- Re-implement setup wrapping and capabilities to preserve existing
behaviour
- Alias `package` options to new lsp module
- Alias `packageFallback` options to new lsp module
- Alias `preConfig` and `postConfig` to `lsp.luaConfig`
We only use `mode`, `key`, `action`, and `options`; so explicitly
inherit those.
This means we don't serialise attrs that aren't needed at runtime,
such as `lspBufAction`.
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.