install-anywhere: Fix by writing age key to new age.pub file

This commit is contained in:
SebastianStork 2025-12-25 21:28:11 +01:00
parent 1170bbf857
commit 2182e06bb6
Signed by: SebastianStork
SSH key fingerprint: SHA256:iEM011ogNMG1q8+U500adGu/9rpPuZ2KnFtbdLeqTiI

View file

@ -35,7 +35,7 @@ _: {
echo "==> Replacing old age key with new age key..."
new_age_key="$(ssh-to-age -i "$ssh_dir/ssh_host_ed25519_key.pub")"
sed -i -E "s|(agePublicKey\s*=\s*\")[^\"]*(\";)|\1$new_age_key\2|" "hosts/$host/default.nix"
echo "$new_age_key" > "hosts/$host/keys/age.pub"
echo "==> Updating SOPS secrets..."
if BW_SESSION="$(bw unlock --raw || bw login --raw)"; then