Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/types/luks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,21 @@ in

askPassword() {
if [ -z ''${IN_DISKO_TEST+x} ]; then
set +x
promptSecret "Enter password for ${config.device}: " password
promptSecret "Enter password for ${config.device} again to be safe: " password_check
export password
[ "$password" = "$password_check" ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably better to use exit 1 if the password don't match instead of setting the debug flags

set -x
else
set -x
export password=disko
set +x
fi
}
set +x
until askPassword; do
echo "Passwords did not match, please try again."
done
set -x
''}
cryptsetup -q luksFormat "${config.device}" ${toString config.extraFormatArgs} ${keyFileArgs}
fi
Expand Down