1# A module containing the base imports and overrides that
2# are always applied in NixOS VM tests, unconditionally,
3# even in `inheritParentConfig = false` specialisations.
4{ lib, ... }:
5let
6 inherit (lib) mkDefault mkForce;
7in
8{
9 imports = [
10 ../../modules/virtualisation/qemu-vm.nix
11 ../../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs
12 {
13 key = "no-manual";
14 documentation.nixos.enable = false;
15 }
16 {
17 key = "no-revision";
18 # Make the revision metadata constant, in order to avoid needless retesting.
19 # The human version (e.g. 21.05-pre) is left as is, because it is useful
20 # for external modules that test with e.g. testers.nixosTest and rely on that
21 # version number.
22 config.system.nixos = {
23 revision = mkForce "constant-nixos-revision";
24 versionSuffix = mkForce "test";
25 label = mkForce "test";
26 };
27 }
28 (
29 { config, ... }:
30 {
31 # Don't pull in switch-to-configuration by default, except when specialisations or early boot shenanigans are involved.
32 # This is mostly a Hydra optimization, so we don't rebuild all the tests every time switch-to-configuration-ng changes.
33 key = "no-switch-to-configuration";
34 system.switch.enable = mkDefault (
35 config.isSpecialisation || config.specialisation != { } || config.virtualisation.installBootLoader
36 );
37 }
38 )
39 ];
40}