mirror of
https://github.com/nix-community/disko.git
synced 2026-11-30 13:03:28 +01:00
luks: don't depend on autogenerated password
This commit is contained in:
1 parent
d60b2b5e00
commit
0d15976fce
1 file changed
+6
-2
+6
-2
@@ -227,13 +227,17 @@ in
|
||||
export SLOT_ZERO_TO_DELETE=true
|
||||
''}
|
||||
cryptsetup -q luksFormat "${config.device}" ${toString config.extraFormatArgs} ${formatKeyFileArgs}
|
||||
fi
|
||||
|
||||
if ! cryptsetup status "${config.name}" >/dev/null; then
|
||||
${formatCryptsetupOpen} \
|
||||
--persistent
|
||||
fi
|
||||
|
||||
# Unlock without relying on the autogenerated password when someone
|
||||
# calls this script after unmounting or rebooting
|
||||
if ! cryptsetup status "${config.name}" >/dev/null; then
|
||||
${cryptsetupOpen}
|
||||
fi
|
||||
|
||||
${toString (
|
||||
lib.forEach config.additionalKeyFiles (keyFile: ''
|
||||
if ! cryptsetup open --test-passphrase --key-file=${keyFile} "${config.device}" 2>/dev/null; then
|
||||
|
||||
Reference in new issue
Block a user