From 0f135fc87bf73fae35066d6bd156c355bb1a4780 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Wed, 26 May 2021 17:19:38 +0200 Subject: [PATCH] unlock: Resolve hostname with hard-coded server This is required after power outages when unlocking the server that does dns in the network. --- flake.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 8248ce6..15a1860 100644 --- a/flake.nix +++ b/flake.nix @@ -120,7 +120,11 @@ ssh \ ${lib.optionalString unlockOverV4 "-4"} \ -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") '') self.nixosConfigurations);