0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

nixos/specialisation: Rephrase in terms of extendModules, noUserModules

This commit is contained in:
Robert Hensing 2021-10-29 13:17:08 +02:00
parent 86f5136baf
commit e2bea4427b
2 changed files with 32 additions and 21 deletions

View file

@ -51,23 +51,28 @@ let
};
};
in rec {
# Merge the option definitions in all modules, forming the full
# system configuration.
inherit (lib.evalModules {
noUserModules = lib.evalModules {
inherit prefix check;
modules = baseModules ++ extraModules ++ [ pkgsModule ] ++ modules;
modules = baseModules ++ extraModules ++ [ pkgsModule ];
args = extraArgs;
specialArgs =
{ modulesPath = builtins.toString ../modules; } // specialArgs;
}) config options _module type;
};
# These are the extra arguments passed to every module. In
# particular, Nixpkgs is passed through the "pkgs" argument.
extraArgs = extraArgs_ // {
inherit baseModules extraModules modules;
inherit noUserModules baseModules extraModules modules;
};
in rec {
# Merge the option definitions in all modules, forming the full
# system configuration.
inherit (noUserModules.extendModules { inherit modules; })
config options _module type;
inherit extraArgs;
inherit (_module.args) pkgs;
}