lol

nixos/testing: Extract nixos-test-base.nix NixOS module

+24 -12
+23
nixos/lib/testing/nixos-test-base.nix
··· 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, ... }: 5 + let 6 + inherit (lib) mkForce; 7 + in 8 + { 9 + imports = [ 10 + ../../modules/virtualisation/qemu-vm.nix 11 + ../../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs 12 + { key = "no-manual"; documentation.nixos.enable = false; } 13 + { 14 + key = "no-revision"; 15 + # Make the revision metadata constant, in order to avoid needless retesting. 16 + # The human version (e.g. 21.05-pre) is left as is, because it is useful 17 + # for external modules that test with e.g. testers.nixosTest and rely on that 18 + # version number. 19 + config.system.nixos.revision = mkForce "constant-nixos-revision"; 20 + } 21 + 22 + ]; 23 + }
+1 -12
nixos/lib/testing/nodes.nix
··· 12 12 modules = [ config.defaults ]; 13 13 baseModules = (import ../../modules/module-list.nix) ++ 14 14 [ 15 - ../../modules/virtualisation/qemu-vm.nix 16 - ../../modules/testing/test-instrumentation.nix # !!! should only get added for automated test runs 17 - { key = "no-manual"; documentation.nixos.enable = false; } 18 - { 19 - key = "no-revision"; 20 - # Make the revision metadata constant, in order to avoid needless retesting. 21 - # The human version (e.g. 21.05-pre) is left as is, because it is useful 22 - # for external modules that test with e.g. testers.nixosTest and rely on that 23 - # version number. 24 - config.system.nixos.revision = mkForce "constant-nixos-revision"; 25 - } 15 + ./nixos-test-base.nix 26 16 { key = "nodes"; _module.args.nodes = nodes; } 27 - 28 17 ({ config, ... }: 29 18 { 30 19 virtualisation.qemu.package = testModuleArgs.config.qemu.package;