forked from mirrors/nixpkgs
a48047a755
This is actually very useful. Allows you to test switch-to-configuration nesting.children is still currently still broken as it will throw away 'too much' of the config, including the modules that make nixos tests work in the first place. But that's something for another time.
23 lines
592 B
Nix
23 lines
592 B
Nix
import ./make-test.nix {
|
|
name = "nesting";
|
|
machine = { pkgs, ... }: {
|
|
environment.systemPackages = [ pkgs.cowsay ];
|
|
nesting.clone = [
|
|
({ pkgs, ... }: {
|
|
environment.systemPackages = [ pkgs.hello ];
|
|
})
|
|
];
|
|
};
|
|
testScript = ''
|
|
$machine->waitForUnit("default.target");
|
|
$machine->succeed("cowsay hey");
|
|
$machine->fail("hello");
|
|
|
|
# Nested clones do inherit from parent
|
|
$machine->succeed("/run/current-system/fine-tune/child-1/bin/switch-to-configuration test");
|
|
$machine->succeed("cowsay hey");
|
|
$machine->succeed("hello");
|
|
|
|
'';
|
|
}
|