nixos.runTest: Add extendNixOS
This commit is contained in:
@@ -3,6 +3,7 @@ testModuleArgs@{
|
||||
lib,
|
||||
hostPkgs,
|
||||
nodes,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
|
||||
@@ -73,6 +74,9 @@ let
|
||||
];
|
||||
};
|
||||
|
||||
# TODO (lib): Dedup with run.nix, add to lib/options.nix
|
||||
mkOneUp = opt: f: lib.mkOverride (opt.highestPrio - 1) (f opt.value);
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
@@ -233,5 +237,23 @@ in
|
||||
))
|
||||
];
|
||||
|
||||
# Docs: nixos/doc/manual/development/writing-nixos-tests.section.md
|
||||
/**
|
||||
See https://nixos.org/manual/nixos/unstable#sec-override-nixos-test
|
||||
*/
|
||||
passthru.extendNixOS =
|
||||
{
|
||||
module,
|
||||
specialArgs ? { },
|
||||
}:
|
||||
config.passthru.extend {
|
||||
modules = [
|
||||
{
|
||||
extraBaseModules = module;
|
||||
node.specialArgs = mkOneUp options.node.specialArgs (_: specialArgs);
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user