diff options
| author | Franck Cuny <franck@fcuny.net> | 2025-12-14 13:01:14 -0800 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2025-12-14 13:01:14 -0800 |
| commit | 0520741b8ab872efcabb16ab3abcb0d6aaaa5718 (patch) | |
| tree | 7156bb80ad72f7c8035dcfca906c4dd98d0d99ac /justfile | |
| parent | remove duplicated configuration for treefmt/pre-commit (diff) | |
| download | infra-0520741b8ab872efcabb16ab3abcb0d6aaaa5718.tar.gz | |
use `just` (again) instead of custom scripts
Diffstat (limited to '')
| -rw-r--r-- | justfile | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/justfile b/justfile new file mode 100644 index 0000000..81bf05f --- /dev/null +++ b/justfile @@ -0,0 +1,52 @@ +# default recipe to display help information +default: + @just --list + +# update the flakes +[group('nix')] +update-deps: + nix flake update --commit-look-file + +# check the flake for errors +[group('nix')] +check: + nix flake check + +# format the repository +[group('nix')] +fmt: + nix fmt + +# build the nix-darwin system configuration without switching to it +[group('darwin')] +build: + @echo "building nix-darwin config..." + darwin-rebuild build --flake . + +# switch the nix-darwin system configuration +[group('darwin')] +switch: + @echo "switching to new config..." + sudo darwin-rebuild switch --flake . + +[group('linux')] +build-iso: + @echo "building an ISO for nixos..." + nix build .#nixosConfigurations.iso.config.system.build.isoImage + +[group('linux')] +rbuild hostname: + @echo "building {{hostname}} nixos config..." + nixos-rebuild build --keep-going --flake ".#{{hostname}}" --target-host {{hostname}} --fast --use-remote-sudo --use-substitutes + +[group('linux')] +rswitch hostname: + @echo "switching {{hostname}} to new config..." + +# sync agenix key from 1password +[group('secrets')] +sync-agenix-key: + @echo "copying agenix SSH key from 1password..." + mkdir -p ~/.ssh + op --account my.1password.com read "op://Private/agenix/private key?ssh-format=openssh" > ~/.ssh/agenix + op --account my.1password.com read "op://Private/agenix/public key" > ~/.ssh/agenix.pub |
