From e738cac18ec1eadfa0cfb52a60955853e6a4531b Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 13 Oct 2023 12:32:19 +0200 Subject: [PATCH] luks: fix interactive mount Before that it was only attempted to unlock luks with the key from `$password`, however that variable didn't exist before. --- lib/types/luks.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/types/luks.nix b/lib/types/luks.nix index 34a2e25..978c54b 100644 --- a/lib/types/luks.nix +++ b/lib/types/luks.nix @@ -137,6 +137,13 @@ in { dev = '' if ! cryptsetup status ${config.name} >/dev/null 2>/dev/null; then + ${lib.optionalString config.askPassword '' + set +x + echo "Enter password for ${config.device}" + read -s password + export password + set -x + ''} cryptsetup open ${config.device} ${config.name} \ ${keyFileArgs} fi