diff --git a/docs/default.nix b/docs/default.nix index 518fcba5..7102923d 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -7,7 +7,7 @@ let # We overlay a few tweaks into pkgs, for use in the docs pkgs = import ./pkgs.nix { inherit system nixpkgs; }; inherit (pkgs) lib; - helpers = import ../lib { inherit lib pkgs; }; + helpers = import ../lib { inherit lib; }; nixvimPath = toString ./..; @@ -34,7 +34,9 @@ let }; evaledModules = lib.evalModules { - inherit (helpers.modules) specialArgs; + specialArgs = helpers.modules.specialArgsWith { + defaultPkgs = pkgs; + }; modules = [ ../modules/top-level { isDocs = true; } diff --git a/flake-modules/legacy-packages.nix b/flake-modules/legacy-packages.nix index 07e7ffa7..072ae066 100644 --- a/flake-modules/legacy-packages.nix +++ b/flake-modules/legacy-packages.nix @@ -1,8 +1,8 @@ +{ helpers, ... }: { perSystem = { pkgs, - helpers, makeNixvimWithModule, ... }: diff --git a/flake-modules/lib.nix b/flake-modules/lib.nix index b0f7c4cc..cc7cc695 100644 --- a/flake-modules/lib.nix +++ b/flake-modules/lib.nix @@ -5,11 +5,7 @@ ... }: { - perSystem = - { pkgs, ... }: - { - _module.args.helpers = import ../lib { inherit lib pkgs; }; - }; + _module.args.helpers = import ../lib { inherit lib; }; # TODO: output lib without pkgs at the top-level flake.lib = lib.genAttrs config.systems ( @@ -18,6 +14,7 @@ { # NOTE: this is the publicly documented flake output we've had for a while check = import ../lib/tests.nix { inherit lib pkgs; }; + # NOTE: user-facing so we must include the legacy `pkgs` argument helpers = import ../lib { inherit lib pkgs; }; } ) diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix index eff37e01..44cd12bf 100644 --- a/flake-modules/tests.nix +++ b/flake-modules/tests.nix @@ -1,11 +1,10 @@ -{ self, ... }: +{ self, helpers, ... }: { perSystem = { pkgs, pkgsUnfree, system, - helpers, makeNixvimWithModule, self', ... diff --git a/lib/tests.nix b/lib/tests.nix index 98523043..7fa70e68 100644 --- a/lib/tests.nix +++ b/lib/tests.nix @@ -45,6 +45,7 @@ let }@args: let helpers = import ../lib { + # NOTE: must match the user-facing functions, so we still include the `pkgs` argument inherit pkgs lib; # TODO: deprecate helpers.enableExceptInTests, # add a context option e.g. `config.isTest`? diff --git a/wrappers/_shared.nix b/wrappers/_shared.nix index 5d4ba0ee..9851d73f 100644 --- a/wrappers/_shared.nix +++ b/wrappers/_shared.nix @@ -46,6 +46,7 @@ in config = mkMerge [ { # Make our lib available to the host modules + # NOTE: user-facing so we must include the legacy `pkgs` argument lib.nixvim = lib.mkDefault (import ../lib { inherit pkgs lib; }); # Make nixvim's "extended" lib available to the host's module args diff --git a/wrappers/standalone.nix b/wrappers/standalone.nix index 6cffc97a..efb3cdf8 100644 --- a/wrappers/standalone.nix +++ b/wrappers/standalone.nix @@ -7,6 +7,7 @@ default_pkgs: self: module, }: let + # NOTE: user-facing so we must include the legacy `pkgs` argument helpers = import ../lib { inherit pkgs lib _nixvimTests; }; inherit (helpers.modules) evalNixvim;