Housekeeping

- Update README
- Run shellcheck on .sh files
- Add helper scripts
- Remove eirene vm variant
- Add post-install checklist

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-08-23 01:22:08 +02:00
parent a048be5c51
commit 78a862bd2e
29 changed files with 582 additions and 434 deletions

23
scripts/add-user.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
if [[ "$#" -ne 2 ]]; then
echo "Usage: $0 <user> <sops-master-key>"
exit 1
fi
USER="$1"
mkdir -p "./users/${USER}/secrets"
nix shell nixpkgs#age --command age-keygen -o "./users/${USER}/secrets/key.txt"
AGE_KEY=$(grep "^# public key: " "./users/${USER}/secrets/key.txt" | sed "s/# public key: //")
for SOPS_FILE in $(find . -type f -name "sops.yaml"); do
sed -i "/- users:/a\ - &${USER} ${AGE_KEY}" "${SOPS_FILE}"
sed -i "/- age:/a\ - *${USER}" "${SOPS_FILE}"
done
"$(dirname "$0")/update-keys.sh" "$2"
echo "User ${USER} has been successfully added."