feat: improve justfiles

This commit is contained in:
Chris Kruining 2025-12-08 16:31:52 +01:00
parent eab9e8b58d
commit 3730ab856b
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
3 changed files with 39 additions and 34 deletions

View file

@ -1,11 +1,14 @@
@_default: list
set unstable := true
set quiet := true
_default: list
[doc('List machines')]
@list:
list:
ls -1 ../systems/x86_64-linux/
[doc('Update the target machine')]
[no-exit-message]
@update machine:
just assert '-d "../systems/x86_64-linux/{{ machine }}"' "Machine {{ machine }} does not exist, must be one of: $(ls ../systems/x86_64-linux/ | sed ':a;N;$!ba;s/\n/, /g')"
nixos-rebuild switch -L --use-remote-sudo --target-host {{ machine }} --flake ..#{{ machine }}
update machine:
just assert '-d "../systems/x86_64-linux/{{ machine }}"' "Machine {{ machine }} does not exist, must be one of: $(ls ../systems/x86_64-linux/ | tr '\n' ' ')"
nixos-rebuild switch --use-remote-sudo --target-host {{ machine }} --flake ..#{{ machine }}