From cd063095892d0e21fee54da92b02f7958de9897b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Giraudeau Date: Tue, 10 Feb 2026 20:47:31 +0100 Subject: [PATCH] lib: luks.create: handle interactive password for existing devices --- lib/types/luks.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/types/luks.nix b/lib/types/luks.nix index 9404711a..843774a0 100644 --- a/lib/types/luks.nix +++ b/lib/types/luks.nix @@ -160,6 +160,16 @@ in done ''} cryptsetup -q luksFormat "${config.device}" ${toString config.extraFormatArgs} ${keyFileArgs} + else + if [ -z ''${IN_DISKO_TEST+x} ]; then + set +x + echo "Enter password for ${config.device}" + IFS= read -r -s password + export password + set -x + else + export password=disko + fi fi if ! cryptsetup status "${config.name}" >/dev/null; then