From baf057aa5b861c549b9ee92807e43ae49ab50cf6 Mon Sep 17 00:00:00 2001 From: a-kenji Date: Wed, 6 May 2026 21:17:15 +0200 Subject: [PATCH] lib/tests: stage the test password file under systemd initrd `boot.initrd.preDeviceCommands` only runs in the script-based stage 1 and is gated on `!config.boot.initrd.systemd.enable`. Tests that enable systemd initrd therefore never get `/tmp/secret.key` staged, and disko's encrypted-filesystem mount hooks fail to find the configured `passwordFile`. --- lib/tests.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/tests.nix b/lib/tests.nix index fdc79bd..c169d94 100644 --- a/lib/tests.nix +++ b/lib/tests.nix @@ -142,6 +142,9 @@ let boot.initrd.preDeviceCommands = lib.mkIf (!config.boot.initrd.systemd.enable) '' echo -n 'secretsecret' > /tmp/secret.key ''; + boot.initrd.secrets = lib.mkIf config.boot.initrd.systemd.enable { + "/tmp/secret.key" = pkgs.writeText "secret.key" "secretsecret"; + }; boot.consoleLogLevel = lib.mkForce 100; boot.loader.systemd-boot.enable = lib.mkDefault efi; };