forked from mirrors/nixpkgs
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
|
||||
# they way through, but has the last priority behind everything else.
|
||||
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_);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -216,6 +216,14 @@ in
|
|||
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 = {
|
||||
|
|
|
@ -15,6 +15,7 @@ let
|
|||
map (childConfig:
|
||||
(import ../../../lib/eval-config.nix {
|
||||
inherit baseModules;
|
||||
system = config.nixpkgs.initialSystem;
|
||||
modules =
|
||||
(optionals inheritParent modules)
|
||||
++ [ ./no-clone.nix ]
|
||||
|
|
|
@ -29,10 +29,10 @@ import ./make-test-python.nix {
|
|||
)
|
||||
clone.succeed("cowsay hey")
|
||||
clone.succeed("hello")
|
||||
|
||||
children.wait_for_unit("default.target")
|
||||
children.succeed("cowsay hey")
|
||||
children.fail("hello")
|
||||
|
||||
children.wait_for_unit("default.target")
|
||||
children.succeed("cowsay hey")
|
||||
children.fail("hello")
|
||||
|
||||
with subtest("Nested children do not inherit from parent"):
|
||||
children.succeed(
|
||||
|
|
Loading…
Reference in a new issue