2024-07-20 13:49:01 +01:00
|
|
|
SOPS_FILE := "~/.local/share/src/nix-secrets/secrets.yaml"
|
2024-05-15 20:44:17 +01:00
|
|
|
|
|
|
|
# default recipe to display help information
|
|
|
|
default:
|
|
|
|
@just --list
|
|
|
|
|
2024-05-16 16:54:21 +01:00
|
|
|
# fetches from remote and updates flake.lock with latest revisions of nix-secrets for next time a rebuild occurs
|
|
|
|
update-flake-secrets:
|
2024-05-15 20:44:17 +01:00
|
|
|
nix flake lock --update-input nix-secrets
|
2024-06-13 23:39:22 +01:00
|
|
|
pkill -RTMIN+11 dwmblocks
|
2024-05-15 20:44:17 +01:00
|
|
|
|
|
|
|
# full system rebuild from flake (stages changes and automatically detects host)
|
|
|
|
rebuild-system:
|
|
|
|
git add *.nix
|
2024-05-25 16:31:51 +01:00
|
|
|
sudo nixos-rebuild switch --option eval-cache false --flake .#$(hostname)
|
2024-05-15 20:44:17 +01:00
|
|
|
|
|
|
|
# updates all flake inputs for system
|
|
|
|
update-flake:
|
|
|
|
nix flake update
|
2024-06-13 23:39:22 +01:00
|
|
|
pkill -RTMIN+11 dwmblocks
|
2024-05-15 20:44:17 +01:00
|
|
|
|
|
|
|
# edit sops file
|
|
|
|
edit-sops:
|
|
|
|
echo "Editing {{SOPS_FILE}}"
|
|
|
|
nix-shell -p sops --run "SOPS_AGE_KEY_FILE=~/.config/sops/age/keys.txt sops {{SOPS_FILE}}"
|
|
|
|
|
2024-05-16 16:54:21 +01:00
|
|
|
# update keys in secrets.yaml and push to remote
|
|
|
|
update-sops-secrets:
|
2024-05-28 20:19:30 +01:00
|
|
|
cd ../nix-secrets && (\
|
2024-05-15 20:44:17 +01:00
|
|
|
nix-shell -p sops --run "sops updatekeys -y secrets.yaml" && \
|
|
|
|
git add -u && (git commit -m "updated secrets" || true) && git push \
|
|
|
|
)
|
2024-05-16 16:54:21 +01:00
|
|
|
|