just: cleanup commands

This commit is contained in:
Alex Maldonado
2026-05-10 10:13:58 -04:00
parent 00c86e4aa0
commit 14ad66fcc8
+17 -12
View File
@@ -1,30 +1,35 @@
host := `hostname` host := `hostname`
key_services := "github gradescope" key_services := "github gradescope"
# Rebuild the system and switch immediately
rebuild: rebuild:
sudo nixos-rebuild switch --flake .#{{host}} sudo nixos-rebuild switch --flake .#{{host}}
# Update flake.lock
update: update:
sudo nix flake update nix flake update
# Clean up old generations and optimize store
gc: gc:
sudo nix-env --delete-generations +3 sudo nix-collect-garbage -d
sudo nix-store --gc sudo nix-store --optimise
sudo nixos-rebuild boot --flake .#{{host}}
# Generate high-strength, post-quantum ready SSH keys without passphrases # Generate Ed25519 SSH keys for each configured service
gen-keys: gen-keys:
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
mkdir -p ~/.ssh mkdir -p ~/.ssh
chmod 700 ~/.ssh
for service in {{key_services}}; do for service in {{key_services}}; do
FILE="$HOME/.ssh/id_$service" file="$HOME/.ssh/id_$service"
if [ -f "$file" ]; then
if [ -f "$FILE" ]; then echo "skipping: $file already exists"
echo "skipping: $FILE already exists." continue
else
echo "generating: $FILE"
ssh-keygen -t ed25519 -a 100 -o -f "$FILE" -N ""
fi fi
echo "generating: $file"
ssh-keygen -t ed25519 -f "$file" -N "" -C "$service@$(hostname -s)"
done done