mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 14:01:34 +01:00
Refactor justfile
This commit is contained in:
parent
33127ac79a
commit
86ba936405
1 changed files with 36 additions and 13 deletions
49
justfile
49
justfile
|
|
@ -1,12 +1,8 @@
|
|||
set quiet := true
|
||||
|
||||
default:
|
||||
list:
|
||||
just --list --unsorted
|
||||
|
||||
rebuild mode='switch':
|
||||
nh os {{ if mode == 'reboot' { 'boot' } else { mode } }} .
|
||||
{{ if mode == 'reboot' { 'reboot' } else { '' } }}
|
||||
|
||||
update:
|
||||
nix flake update --commit-lock-file
|
||||
|
||||
|
|
@ -16,32 +12,59 @@ fmt:
|
|||
check:
|
||||
nix flake check --no-build
|
||||
|
||||
deploy +hosts:
|
||||
deploy --skip-checks --targets $(echo {{ hosts }} | sed 's/[^ ]*/\.#&/g')
|
||||
|
||||
install host destination='root@installer':
|
||||
nix run .#install-anywhere -- {{ host }} {{ destination }}
|
||||
|
||||
repair:
|
||||
nix-store --verify --check-contents --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
|
||||
[group('rebuild')]
|
||||
rebuild mode='switch':
|
||||
nh os {{ mode }} .
|
||||
|
||||
[group('rebuild')]
|
||||
switch:
|
||||
rebuild switch
|
||||
|
||||
[group('rebuild')]
|
||||
test:
|
||||
just rebuild test
|
||||
|
||||
[group('rebuild')]
|
||||
boot:
|
||||
just rebuild boot
|
||||
|
||||
[group('rebuild')]
|
||||
reboot:
|
||||
just boot && reboot
|
||||
|
||||
[group('remote')]
|
||||
deploy +hosts:
|
||||
deploy --skip-checks --targets $(echo {{ hosts }} | sed 's/[^ ]*/\.#&/g')
|
||||
|
||||
[group('remote')]
|
||||
install host destination='root@installer':
|
||||
nix run .#install-anywhere -- {{ host }} {{ destination }}
|
||||
|
||||
[group('sops')]
|
||||
sops-edit path:
|
||||
just _sops-do "sops edit {{ path }}"
|
||||
|
||||
[group('sops')]
|
||||
sops-update path:
|
||||
just _sops-do "sops updatekeys {{ path }}"
|
||||
|
||||
[group('sops')]
|
||||
sops-update-all:
|
||||
just _sops-do "find . -type f -name 'secrets.json' -exec sops updatekeys --yes {} \;"
|
||||
|
||||
[group('sops')]
|
||||
sops-rotate path:
|
||||
just _sops-do "sops rotate --in-place {{ path }}"
|
||||
|
||||
[group('sops')]
|
||||
sops-rotate-all:
|
||||
just _sops-do "find . -type f -name 'secrets.json' -exec sops rotate --in-place {} \;"
|
||||
|
||||
_sops-do command:
|
||||
-if command -v sops >/dev/null 2>&1; then {{ command }}; else nix develop .#sops --command bash -c "{{ command }}; exec zsh"; fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue