nixos/tests: don't include switch-to-configuration in DUT by default

This commit is contained in:
K900 2024-09-08 08:27:28 +03:00
parent 7771e0b943
commit 4cfbbb3c1d

View File

@ -3,7 +3,7 @@
# even in `inheritParentConfig = false` specialisations. # even in `inheritParentConfig = false` specialisations.
{ lib, ... }: { lib, ... }:
let let
inherit (lib) mkForce; inherit (lib) mkDefault mkForce;
in in
{ {
imports = [ imports = [
@ -22,6 +22,11 @@ in
label = mkForce "test"; label = mkForce "test";
}; };
} }
({ config, ... }: {
# Don't pull in switch-to-configuration by default, except when specialisations are involved.
# This is mostly a Hydra optimization, so we don't rebuild all the tests every time switch-to-configuration-ng changes.
key = "no-switch-to-configuration";
system.switch.enable = mkDefault (config.isSpecialisation || config.specialisation != {});
})
]; ];
} }