modules: move nixpkgs module to top-level modules

Make `pkgs` available to files submodules by passing _all_ module args
through. We already did this for `specialArgs`.
This commit is contained in:
Matt Sturgeon 2024-09-20 09:00:43 +01:00
parent 31579dc201
commit 8c3d521bff
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
4 changed files with 10 additions and 1 deletions

View file

@ -3,7 +3,6 @@
./assertions.nix
./context.nix
./meta.nix
./nixpkgs.nix
./nixvim-info.nix
];
}

View file

@ -7,6 +7,7 @@
imports = [
../.
./files
./nixpkgs.nix
./output.nix
./readonly-renames.nix
./test.nix

View file

@ -15,6 +15,15 @@ let
modules = lib.optionals (!config.isDocs) [
../../.
./submodule.nix
# Pass module args through to the submodule (except `name`)
# Wrap each arg with the correct priority
{
_module.args = lib.pipe options._module.args [
lib.modules.mergeAttrDefinitionsWithPrio
(lib.flip builtins.removeAttrs [ "name" ])
(lib.mapAttrs (_: { highestPrio, value }: lib.mkOverride highestPrio value))
];
}
];
description = "Nixvim configuration";
};