shell/unlock: Make unlock work if agent is locked

pull/48/head
Simon Bruder 2021-02-16 15:54:22 +01:00
parent 27285a098f
commit 16c710d4a5
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
1 changed files with 2 additions and 0 deletions

View File

@ -34,6 +34,8 @@ let
set -eo pipefail
machine="$1"
hostname="$(nix-instantiate --eval --json machines -A "$1".target | ${pkgs.jq}/bin/jq -r . | cut -d@ -f2)"
# opening luks fails if gpg-agent is not unlocked yet
pass "devices/$machine/luks" >/dev/null
ssh \
-oStrictHostKeyChecking=no \
-oGlobalKnownHostsFile=<(echo "[$hostname]:2222 ssh-ed25519 $(ssh-keygen -l -f <(ssh-keygen -y -f<(pass "nixos/machines/$machine/initrd-ssh-host-key")) | cut -d' ' -f2)") \