unlock: Resolve hostname with hard-coded server

This is required after power outages when unlocking the server that does
dns in the network.
This commit is contained in:
Simon Bruder 2021-05-26 17:19:38 +02:00
parent ab4ef486be
commit 0f135fc87b
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -120,7 +120,11 @@
ssh \ ssh \
${lib.optionalString unlockOverV4 "-4"} \ ${lib.optionalString unlockOverV4 "-4"} \
-p 2222 \ -p 2222 \
"root@${targetHost}" \ "root@$(${pkgs.dnsutils}/bin/dig \
+short \
@${if unlockOverV4 then "8.8.8.8" else "2001:4860:4860::8888"} \
${targetHost} \
${if unlockOverV4 then "A" else "AAAA"})" \
"cat > /crypt-ramfs/passphrase" < <(pass "devices/${hostname}/luks") "cat > /crypt-ramfs/passphrase" < <(pass "devices/${hostname}/luks")
'') '')
self.nixosConfigurations); self.nixosConfigurations);