Fix utility script bugs

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-12-20 10:00:01 +00:00
parent dbc913fcd8
commit 6c32412fa3
7 changed files with 35 additions and 20 deletions

View File

@@ -17,7 +17,7 @@ ssh-keygen -t ed25519 -f "./hosts/${HOST}/secrets/ssh_host_ed25519_key" -N ""
AGE_KEY=$(nix shell nixpkgs#ssh-to-age --command bash -c "cat './hosts/${HOST}/secrets/ssh_host_ed25519_key.pub' | ssh-to-age")
for SOPS_FILE in $(find . -type f -name "sops.yaml"); do
find . -type f -name "sops.yaml" | while IFS= read -r SOPS_FILE; do
sed -i "/- hosts:/a\ - &${HOST} ${AGE_KEY}" "${SOPS_FILE}"
sed -i "/- age:/a\ - *${HOST}" "${SOPS_FILE}"
done