From 2787b874601d88e5b44754b7a6607f7e44cb60e7 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Sun, 7 Jun 2026 14:44:10 +0300 Subject: [PATCH 1/3] nixosTests.systemd-initrd-luks-fido2: don't rely on autoFormat b5611f96b6e1 dropped the patch that originally made this work, fix the test in the same way as what was done in b13891782fde. --- nixos/tests/systemd-initrd-luks-fido2.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/tests/systemd-initrd-luks-fido2.nix b/nixos/tests/systemd-initrd-luks-fido2.nix index 783b9d7426e7..3c191dcbf509 100644 --- a/nixos/tests/systemd-initrd-luks-fido2.nix +++ b/nixos/tests/systemd-initrd-luks-fido2.nix @@ -38,7 +38,6 @@ }; }; virtualisation.rootDevice = "/dev/mapper/cryptroot"; - virtualisation.fileSystems."/".autoFormat = true; }; }; @@ -52,6 +51,8 @@ # Create encrypted volume machine.wait_for_unit("multi-user.target") machine.succeed("echo -n supersecret | cryptsetup luksFormat -q --iter-time=1 /dev/vdb -") + machine.succeed("echo -n supersecret | cryptsetup luksOpen -q /dev/vdb cryptroot") + machine.succeed("mkfs.ext4 /dev/mapper/cryptroot") machine.succeed("PASSWORD=supersecret SYSTEMD_LOG_LEVEL=debug systemd-cryptenroll --fido2-device=auto /dev/vdb |& systemd-cat") # Boot from the encrypted disk From def1405cd3a395c682694a1113d310e9b750f2a7 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Sun, 7 Jun 2026 14:50:25 +0300 Subject: [PATCH 2/3] nixosTests.systemd-initrd-luks-unl0kr: fix testScript indentation --- nixos/tests/systemd-initrd-luks-unl0kr.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/tests/systemd-initrd-luks-unl0kr.nix b/nixos/tests/systemd-initrd-luks-unl0kr.nix index b48bd2d1588f..4686fa0c5b02 100644 --- a/nixos/tests/systemd-initrd-luks-unl0kr.nix +++ b/nixos/tests/systemd-initrd-luks-unl0kr.nix @@ -73,7 +73,6 @@ in cryptroot2.device = "/dev/vdc"; }; virtualisation.rootDevice = "/dev/mapper/cryptroot"; - virtualisation.fileSystems."/".autoFormat = true; # test mounting device unlocked in initrd after switching root virtualisation.fileSystems."/cryptroot2" = { device = "/dev/mapper/cryptroot2"; @@ -100,7 +99,7 @@ in machine.succeed("mkfs.ext4 /dev/mapper/cryptroot2") # Boot from the encrypted disk - machine.succeed("${boot-luks}/bin/switch-to-configuration boot") + machine.succeed("${boot-luks}/bin/switch-to-configuration boot") machine.succeed("sync") machine.crash() From 1e9305e34606fb75f5808d05d886bae6523f6752 Mon Sep 17 00:00:00 2001 From: r-vdp Date: Sun, 7 Jun 2026 15:05:55 +0300 Subject: [PATCH 3/3] systemd: re-enable systemd-initrd-luks-fido2 in passthru.tests --- pkgs/os-specific/linux/systemd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 7451a098ae33..6af44a1f2b30 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -791,7 +791,7 @@ stdenv.mkDerivation (finalAttrs: { systemd-credentials-tpm2 systemd-escaping systemd-initrd-btrfs-raid - # systemd-initrd-luks-fido2 # broken on master + systemd-initrd-luks-fido2 systemd-initrd-luks-keyfile systemd-initrd-luks-empty-passphrase systemd-initrd-luks-password