feat: justfile recipe improvements

This commit is contained in:
2026-05-10 00:08:17 +02:00
parent 79a67284af
commit 325b863238

View File

@@ -2,31 +2,20 @@
default: default:
@just --list @just --list
# rebuild and switch # rebuild the system
switch config="": rebuild op="switch" host=`hostname`:
nixos-rebuild switch --flake .{{ if config != "" { "#" + config } else { "" } }} --sudo nixos-rebuild {{op}} --flake .#{{host}} --sudo
# fetch flake inputs
sync:
nix flake prefetch-inputs
# update flake inputs # update flake inputs
update: update:
nix flake update nix flake update
# update flake inputs, rebuild and switch
bump: update switch
# update a package to latest version
update-package pkg:
bash packages/{{pkg}}/update.sh
# update all packages with update scripts # update all packages with update scripts
update-package-all: update-package:
@for script in packages/*/update.sh; do bash "$script"; done @for script in packages/*/update.sh; do bash "$script"; done
# build all packages and hosts # build all packages and hosts
build: check:
nix flake check nix flake check
# build installation iso # build installation iso
@@ -37,10 +26,6 @@ iso:
ephvm *ARGS: ephvm *ARGS:
bash scripts/ephvm-run.sh {{ARGS}} bash scripts/ephvm-run.sh {{ARGS}}
# ssh into running ephemeral VM
ephvm-ssh port="2222":
ssh -p {{port}} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null matej@localhost
# provision a host with nixos-anywhere # provision a host with nixos-anywhere
provision host ip: provision host ip:
#!/usr/bin/env bash #!/usr/bin/env bash
@@ -59,8 +44,8 @@ provision host ip:
ssh root@{{ip}} reboot ssh root@{{ip}} reboot
# deploy config to a remote host # deploy config to a remote host
deploy host remote=host: deploy op="switch" host=`hostname` remote=host:
nixos-rebuild switch --flake .#{{host}} --target-host {{remote}} --sudo --ask-sudo-password nixos-rebuild {{op}} --flake .#{{host}} --target-host {{remote}} --sudo --ask-sudo-password
# garbage collect old generations # garbage collect old generations
clean host=`hostname`: clean host=`hostname`: