unlock: Simplify

This commit is contained in:
Simon Bruder 2024-05-11 23:45:51 +02:00
parent 76e1ec00af
commit 8b9a469153
Signed by: simon
GPG key ID: 347FF8699CDA0776

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);