From 93ec363394596736e97e45f21cc9afd4ebd367d1 Mon Sep 17 00:00:00 2001 From: Hussain Miyaziwala Date: Sat, 8 Aug 2026 08:51:29 -0400 Subject: [PATCH] luks: probe detached headers --- lib/types/luks.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/types/luks.nix b/lib/types/luks.nix index 9fc0b02..9498221 100644 --- a/lib/types/luks.nix +++ b/lib/types/luks.nix @@ -10,6 +10,11 @@ let # These options will automatically generate a temporary password and remove it later on. autogeneratedPassword = config.enrollFido2; + luksProbeTarget = + if config.settings ? "header" && config.settings.header != null then + config.settings.header + else + config.device; keyFile = if config.settings ? "keyFile" then @@ -199,7 +204,7 @@ in _create = diskoLib.mkCreateOption { inherit config options; default = '' - if ! blkid "${config.device}" >/dev/null || ! cryptsetup isLuks "${config.device}"; then + if ! cryptsetup isLuks "${luksProbeTarget}"; then ${lib.optionalString config.askPassword '' promptSecret() { prompt=$1