feat: improve justfiles

This commit is contained in:
Chris Kruining 2025-11-27 11:44:18 +01:00
parent 8da8f78ea4
commit ccef5caba0
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
3 changed files with 58 additions and 51 deletions

View file

@ -1,11 +1,14 @@
@_default: list
set unstable := true
set quiet := true
_default: list
[doc('List machines')]
@list:
ls -1 ../systems/x86_64-linux/
list:
ls -1 ../systems/x86_64-linux/
[no-exit-message]
[doc('Update the target 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 }}
[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/ | tr '\n' ' ')"
nixos-rebuild switch --use-remote-sudo --target-host {{ machine }} --flake ..#{{ machine }}