Merge pull request #81241 from thefloweringash/nesting-system
nixos/activation: propagate system to nested configurations
This commit is contained in:
commit
7b15d6cee4
|
@ -41,6 +41,12 @@ let
|
||||||
# default to the argument. That way this new default could propagate all
|
# default to the argument. That way this new default could propagate all
|
||||||
# they way through, but has the last priority behind everything else.
|
# they way through, but has the last priority behind everything else.
|
||||||
nixpkgs.system = lib.mkDefault system;
|
nixpkgs.system = lib.mkDefault system;
|
||||||
|
|
||||||
|
# Stash the value of the `system` argument. When using `nesting.children`
|
||||||
|
# we want to have the same default value behavior (immediately above)
|
||||||
|
# without any interference from the user's configuration.
|
||||||
|
nixpkgs.initialSystem = system;
|
||||||
|
|
||||||
_module.args.pkgs = lib.mkIf (pkgs_ != null) (lib.mkForce pkgs_);
|
_module.args.pkgs = lib.mkIf (pkgs_ != null) (lib.mkForce pkgs_);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -216,6 +216,14 @@ in
|
||||||
Ignored when <code>nixpkgs.pkgs</code> is set.
|
Ignored when <code>nixpkgs.pkgs</code> is set.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
initialSystem = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
internal = true;
|
||||||
|
description = ''
|
||||||
|
Preserved value of <literal>system</literal> passed to <literal>eval-config.nix</literal>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
|
@ -15,6 +15,7 @@ let
|
||||||
map (childConfig:
|
map (childConfig:
|
||||||
(import ../../../lib/eval-config.nix {
|
(import ../../../lib/eval-config.nix {
|
||||||
inherit baseModules;
|
inherit baseModules;
|
||||||
|
system = config.nixpkgs.initialSystem;
|
||||||
modules =
|
modules =
|
||||||
(optionals inheritParent modules)
|
(optionals inheritParent modules)
|
||||||
++ [ ./no-clone.nix ]
|
++ [ ./no-clone.nix ]
|
||||||
|
|
|
@ -29,10 +29,10 @@ import ./make-test-python.nix {
|
||||||
)
|
)
|
||||||
clone.succeed("cowsay hey")
|
clone.succeed("cowsay hey")
|
||||||
clone.succeed("hello")
|
clone.succeed("hello")
|
||||||
|
|
||||||
children.wait_for_unit("default.target")
|
children.wait_for_unit("default.target")
|
||||||
children.succeed("cowsay hey")
|
children.succeed("cowsay hey")
|
||||||
children.fail("hello")
|
children.fail("hello")
|
||||||
|
|
||||||
with subtest("Nested children do not inherit from parent"):
|
with subtest("Nested children do not inherit from parent"):
|
||||||
children.succeed(
|
children.succeed(
|
||||||
|
|
Loading…
Reference in New Issue