The `import module args` pattern is useful for applying inputs from
outside of the module system, however it discards module location
metadata that is usually associated with file-path modules.
`lib.modules.importApply` solves that problem by wrapping the applied
module using `lib.modules.setDefaultModuleLocation`.
This means documentation, warnings, and errors will show the correct
location.
Previously, we constructed Nixvim's extended lib from the host
configuration's lib.
Naïvely, this potentially allowed fetching fewer Nixpkgs revisions and
instantiating fewer lib instances. However, it also means our `lib`
interface is unstable, especially when the host configuration is using a
different Nixpkgs release to Nixvim.
Automated update of the master maintainers list combining:
- Nixvim specific maintainers from lib/maintainers.nix
- Nixpkgs maintainers referenced in Nixvim modules
Changes: +7 -0 lines
Generated by: flake/dev/generate-all-maintainers/generate-all-maintainers.py
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
The lib-overlay was previously wrapped using `makeOverridable`, but its
only input is the flake itself, which is not intended to be overridden.
Remove the wrapper and expose the overlay as a plain function.
Previously, `lib/top-level.nix` used an `_isExtended` flag to indicate
whether the provided `lib` was already extended. This made bootstrapping
unclear and introduced the possibility of circular construction.
All construction now flows through the lib-overlay, removing
`_isExtended`. As a result, `lib/top-level.nix` always receives the
final extended lib.
The `<flake>.lib.nixvim` output is now defined as:
(lib.extend <nixvim>.lib.overlay).nixvim
The overlay now imports `top-level.nix` directly, making it the
canonical entrypoint for constructing Nixvim's section of the lib.
A clarifying doccomment was added to `lib/top-level.nix`.
Rename the overlay arguments from the conventional `final: prev:` to the
more explicit `lib: prevLib:`, reflecting that this overlay operates
only on the Nixpkgs lib, rather than a full package set.
Add a doccomment explaining how the overlay is intended to be applied
(via `lib.extend`) and what each argument represents.
Improved inline comments in the overlay.
Rename `lib/default.nix` to `lib/top-level.nix` to make its purpose
explicit and discourage importing it directly. Consumers should obtain
the extended lib via flake outputs or the overlay, rather than bypassing
the required bootstrapping logic.
This clarifies the file's role and avoids suggesting it is the primary
entrypoint to Nixvim's lib subsection.
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.
Automated update of the master maintainers list combining:
- Nixvim specific maintainers from lib/maintainers.nix
- Nixpkgs maintainers referenced in Nixvim modules
Changes: +7 -0 lines
Generated by: flake/dev/generate-all-maintainers/generate-all-maintainers.py