1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-25 19:51:06 +01:00

wrappers: use flake-locked lib instead of host's

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.
This commit is contained in:
Matt Sturgeon 2025-11-23 23:58:23 +00:00
parent 2606dc7194
commit 3426dd04bb

View file

@ -70,10 +70,16 @@ in
config = mkMerge [
{
# Make our lib available to the host modules
# - the `config.lib.nixvim` option is the nixvim-lib
# - the `nixvimLib` arg is `lib` extended with our overlay
lib.nixvim = lib.mkDefault config._module.args.nixvimLib.nixvim;
# Make Nixvim's extended lib available to the host modules
# - The `config.lib.nixvim` option is Nixvim's section of the lib
# (based on our flake's locked Nixpkgs lib)
# - The `nixvimLib` arg is `lib` extended with our overlay
# (based on the host configuration's `lib`)
#
# NOTE: It is important that we use the flake-locked Nixpkgs lib,
# so that we can safely use recently added lib features.
# TODO: Consider deprecating `_module.args.nixvimLib`?
lib.nixvim = lib.mkDefault self.lib.nixvim;
_module.args.nixvimLib = lib.mkDefault (lib.extend self.lib.overlay);
}