justfile: add repl, eval and eval-vm

This commit is contained in:
Peder Bergebakken Sundt 2025-05-30 19:15:48 +02:00
parent 3e156a8649
commit e5b38cd2c1

View File

@ -22,6 +22,14 @@ run-vm machine=`just _a_machine` *_:
| gum choose --no-limit --height=15 \
| xargs -L 1 nix flake lock --update-input "$@"
@repl $machine=`just _a_machine` *_:
set -v; nixos-rebuild --flake .#"$machine" repl "${@:2}"
@eval $machine=`just _a_machine` $attrpath="system.build.toplevel.outPath" *_:
set -v; nix eval {{nix_eval_opts}} ".#nixosConfigurations.\"$machine\".config.$attrpath" --show-trace "${@:3}"
@eval-vm $machine=`just _a_machine` $attrpath="system.build.toplevel.outPath" *_:
just eval "$machine" "virtualisation.vmVariant.$attrpath" "${@:3}"
# helpers