nixos/testing: Extract nixos-test-base.nix NixOS module
This commit is contained in:
parent
38fb09e427
commit
24d1d74e4e
23
nixos/lib/testing/nixos-test-base.nix
Normal file
23
nixos/lib/testing/nixos-test-base.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
# A module containing the base imports and overrides that
|
||||
# are always applied in NixOS VM tests, unconditionally,
|
||||
# even in `inheritParentConfig = false` specialisations.
|
||||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib) mkForce;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../../modules/virtualisation/qemu-vm.nix
|
||||
../../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs
|
||||
{ key = "no-manual"; documentation.nixos.enable = false; }
|
||||
{
|
||||
key = "no-revision";
|
||||
# Make the revision metadata constant, in order to avoid needless retesting.
|
||||
# The human version (e.g. 21.05-pre) is left as is, because it is useful
|
||||
# for external modules that test with e.g. testers.nixosTest and rely on that
|
||||
# version number.
|
||||
config.system.nixos.revision = mkForce "constant-nixos-revision";
|
||||
}
|
||||
|
||||
];
|
||||
}
|
|
@ -12,19 +12,8 @@ let
|
|||
modules = [ config.defaults ];
|
||||
baseModules = (import ../../modules/module-list.nix) ++
|
||||
[
|
||||
../../modules/virtualisation/qemu-vm.nix
|
||||
../../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs
|
||||
{ key = "no-manual"; documentation.nixos.enable = false; }
|
||||
{
|
||||
key = "no-revision";
|
||||
# Make the revision metadata constant, in order to avoid needless retesting.
|
||||
# The human version (e.g. 21.05-pre) is left as is, because it is useful
|
||||
# for external modules that test with e.g. testers.nixosTest and rely on that
|
||||
# version number.
|
||||
config.system.nixos.revision = mkForce "constant-nixos-revision";
|
||||
}
|
||||
./nixos-test-base.nix
|
||||
{ key = "nodes"; _module.args.nodes = nodes; }
|
||||
|
||||
({ config, ... }:
|
||||
{
|
||||
virtualisation.qemu.package = testModuleArgs.config.qemu.package;
|
||||
|
|
Loading…
Reference in a new issue