mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 13:39:15 +03:00
Revert "nixos/specialisation: Rephrase in terms of extendModules, noUserModules"
This reverts commit e2bea4427b
.
While this commit was probably fine, I want to be conservative
with changes right before the release branch-off.
So far the extendModules commits have been adding and refactoring
expressions that did not affect derivation hashes, whereas this
commit changes the module ordering. I will open a separate PR for
it.
This commit is contained in:
parent
e2bea4427b
commit
0b0d2637fc
2 changed files with 25 additions and 36 deletions
|
@ -51,28 +51,23 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
noUserModules = lib.evalModules {
|
|
||||||
inherit prefix check;
|
|
||||||
modules = baseModules ++ extraModules ++ [ pkgsModule ];
|
|
||||||
args = extraArgs;
|
|
||||||
specialArgs =
|
|
||||||
{ modulesPath = builtins.toString ../modules; } // specialArgs;
|
|
||||||
};
|
|
||||||
|
|
||||||
# These are the extra arguments passed to every module. In
|
|
||||||
# particular, Nixpkgs is passed through the "pkgs" argument.
|
|
||||||
extraArgs = extraArgs_ // {
|
|
||||||
inherit noUserModules baseModules extraModules modules;
|
|
||||||
};
|
|
||||||
|
|
||||||
in rec {
|
in rec {
|
||||||
|
|
||||||
# Merge the option definitions in all modules, forming the full
|
# Merge the option definitions in all modules, forming the full
|
||||||
# system configuration.
|
# system configuration.
|
||||||
inherit (noUserModules.extendModules { inherit modules; })
|
inherit (lib.evalModules {
|
||||||
config options _module type;
|
inherit prefix check;
|
||||||
|
modules = baseModules ++ extraModules ++ [ pkgsModule ] ++ modules;
|
||||||
|
args = extraArgs;
|
||||||
|
specialArgs =
|
||||||
|
{ modulesPath = builtins.toString ../modules; } // specialArgs;
|
||||||
|
}) config options _module type;
|
||||||
|
|
||||||
inherit extraArgs;
|
# 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 (_module.args) pkgs;
|
inherit (_module.args) pkgs;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, pkgs, extendModules, noUserModules, ... }:
|
{ config, lib, pkgs, modules, baseModules, specialArgs, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -11,10 +11,16 @@ let
|
||||||
# you can provide an easy way to boot the same configuration
|
# you can provide an easy way to boot the same configuration
|
||||||
# as you use, but with another kernel
|
# as you use, but with another kernel
|
||||||
# !!! fix this
|
# !!! fix this
|
||||||
children =
|
children = mapAttrs (childName: childConfig:
|
||||||
mapAttrs
|
(import ../../../lib/eval-config.nix {
|
||||||
(childName: childConfig: childConfig.configuration.system.build.toplevel)
|
inherit lib baseModules specialArgs;
|
||||||
config.specialisation;
|
system = config.nixpkgs.initialSystem;
|
||||||
|
modules =
|
||||||
|
(optionals childConfig.inheritParentConfig modules)
|
||||||
|
++ [ ./no-clone.nix ]
|
||||||
|
++ [ childConfig.configuration ];
|
||||||
|
}).config.system.build.toplevel
|
||||||
|
) config.specialisation;
|
||||||
|
|
||||||
systemBuilder =
|
systemBuilder =
|
||||||
let
|
let
|
||||||
|
@ -170,11 +176,7 @@ in
|
||||||
</screen>
|
</screen>
|
||||||
'';
|
'';
|
||||||
type = types.attrsOf (types.submodule (
|
type = types.attrsOf (types.submodule (
|
||||||
local@{ ... }: let
|
{ ... }: {
|
||||||
extend = if local.config.inheritParentConfig
|
|
||||||
then extendModules
|
|
||||||
else noUserModules.extendModules;
|
|
||||||
in {
|
|
||||||
options.inheritParentConfig = mkOption {
|
options.inheritParentConfig = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
@ -183,15 +185,7 @@ in
|
||||||
|
|
||||||
options.configuration = mkOption {
|
options.configuration = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
description = ''
|
description = "Arbitrary NixOS configuration options.";
|
||||||
Arbitrary NixOS configuration.
|
|
||||||
|
|
||||||
Anything you can add to a normal NixOS configuration, you can add
|
|
||||||
here, including imports and config values, although nested
|
|
||||||
specialisations will be ignored.
|
|
||||||
'';
|
|
||||||
visible = "shallow";
|
|
||||||
inherit (extend { modules = [ ./no-clone.nix ]; }) type;
|
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue