fix: add host keys when deploying to a new machine so it will decrypt secrets

This commit is contained in:
Mohammad Rafiq 2025-03-27 07:50:32 +08:00
parent 8a272b6410
commit 6de54986de
No known key found for this signature in database

View file

@ -24,11 +24,9 @@ done
# Prepare temporary directory and copy necessary files # Prepare temporary directory and copy necessary files
root=$(mktemp -d) root=$(mktemp -d)
sudo mkdir -p ${root}/home/rafiq/.config/sops/age sudo cp --verbose --archive --parents /etc/ssh/ssh_host_* ${root}
sudo cp ~/.config/sops/age/keys.txt "${root}/home/rafiq/.config/sops/age/keys.txt" sudo cp --verbose --archive --parents ~/.ssh/id_ed25519 ${root}
sudo mkdir -p ${root}/home/rafiq/.ssh sudo cp --verbose --archive --parents ~/.config/sops/age/keys.txt ${root}
sudo cp ~/.ssh/id_ed25519 "${root}/home/rafiq/.ssh/id_ed25519"
sudo cp ~/.ssh/id_ed25519.pub "${root}/home/rafiq/.ssh/id_ed25519.pub"
# Run nixos-anywhere # Run nixos-anywhere
sudo nix run github:nix-community/nixos-anywhere -- \ sudo nix run github:nix-community/nixos-anywhere -- \