From 0119af4d40383dfce4ce249a7ef969f3fa92214e Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Sat, 6 Sep 2025 00:13:14 +0200 Subject: [PATCH] justfile: Add sops commands --- justfile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index 2a4ef3b..304a8c7 100644 --- a/justfile +++ b/justfile @@ -16,9 +16,6 @@ fmt: check: nix flake check --no-build -dev shell='default': - nix develop .#{{ shell }} --command $SHELL - deploy +hosts: deploy --skip-checks --targets $(echo {{ hosts }} | sed 's/[^ ]*/\.#&/g') @@ -30,3 +27,15 @@ repair: repl host='$(hostname)': nix repl .#nixosConfigurations.{{ host }} + +_sops-do command: + -if command -v sops >/dev/null 2>&1; then {{ command }}; else nix develop .#sops --command bash -c "{{ command }}; exec zsh"; fi + +sops-edit path: + just _sops-do "sops edit {{ path }}" + +sops-update: + just _sops-do "find . -type f -name 'secrets.json' -exec sops updatekeys --yes {} \;" + +sops-rotate: + just _sops-do "find . -type f -name 'secrets.json' -exec sops rotate --in-place {} \;"