nixos: Make 'nesting.clone' work in NixOS tests
Because nesting.clone calls 'eval-config.nix' manually,
without the 'extraArgs' argument that provides the 'nodes'
argument to nixos modules in nixos tests, evaluating
of 'nesting.clone' definitions would fail with the following error
while evaluating the module argument `nodes' in "<redacted>"
while evaluating the attribute '_module.args.nodes' at undefined position:
attribute 'nodes' missing, at <redacted./nixpkgs/lib/modules.nix:163:28
by not using 'extraArgs' but a nixos module instead, the nodes parameter
gets propagated to the 'eval-config.nix' call that 'nesting.clone'
makes too - getting rid of the error.
See https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/activation/top-level.nix#L13-L23
See https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/build-vms.nix#L27
See https://github.com/NixOS/nixpkgs/issues/20886#issuecomment-495952149
commitd50b43423455ac06f3e237dbc0a0c98bcb4b5dcf
authorArian van Putten <aeroboy94@gmail.com>
dateSun 26 May 2019, 00:15 (7 years ago)
parentfcd012e
nixos/lib/build-vms.nix+1−1
@@ -37,9 +37,9 @@ rec {
3737 ../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs
3838 { key = "no-manual"; documentation.nixos.enable = false; }
3939 { key = "qemu"; system.build.qemu = qemu; }
40+ { key = "nodes"; _module.args.nodes = nodes; }
4041 ] ++ optional minimal ../modules/testing/minimal-kernel.nix
4142 ++ extraConfigurations;
42− extraArgs = { inherit nodes; };
4343 };
4444
4545