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:
parent
86f5136baf
commit
e2bea4427b
2 changed files with 32 additions and 21 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue