unlock: Simplify

Simon Bruder 2024-05-11 23:45:51 +02:00
parent 7523f70bf0
commit ada59a1fbd
Signed by: simon
GPG Key ID: 347FF8699CDA0776
1 changed files with 2 additions and 3 deletions

View File

@ -156,12 +156,11 @@
pkgs.writeShellScript "unlock-${hostname}" ''
set -exo pipefail
# opening luks fails if gpg-agent is not unlocked yet
pass "devices/${hostname}/luks" >/dev/null
ssh \
pass "devices/${hostname}/luks" | ssh \
${lib.optionalString unlockOverV4 "-4"} \
-p 2222 \
"root@${targetHost}" \
"cat > /crypt-ramfs/passphrase" < <(pass "devices/${hostname}/luks")
"cat > /crypt-ramfs/passphrase"
'')
self.nixosConfigurations);