diff --git a/lib/tests.nix b/lib/tests.nix index e2e8f60d..4be22623 100644 --- a/lib/tests.nix +++ b/lib/tests.nix @@ -86,7 +86,7 @@ let tsp-config = tsp-generator.config testConfigBooted; num-disks = builtins.length (lib.attrNames testConfigBooted.disko.devices.disk); - installed-system = { ... }: { + installed-system = { config, ... }: { imports = [ (lib.optionalAttrs (testMode == "direct") tsp-config) (lib.optionalAttrs (testMode == "module") { @@ -101,11 +101,14 @@ let # config for tests to make them run faster or work at all documentation.enable = false; hardware.enableAllFirmware = lib.mkForce false; - boot.initrd.preDeviceCommands = '' + boot.initrd.preDeviceCommands = lib.mkIf (!config.boot.initrd.systemd.enable) '' echo -n 'secretsecret' > /tmp/secret.key ''; + boot.initrd.systemd.contents."/tmp/secret.key".text = "secretsecret"; boot.consoleLogLevel = lib.mkForce 100; boot.loader.systemd-boot.enable = lib.mkDefault efi; + + boot.initrd.systemd.enable = true; }; installed-system-eval = eval-config {