From e14ebf98ca0b6adb5abdcf87a4caaf7acb07227a Mon Sep 17 00:00:00 2001 From: Emile Clark-Boman Date: Sat, 31 Jan 2026 10:14:46 +1000 Subject: [PATCH] add --show-flags and EXTRA_FLAGS to ./deploy --- deploy | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/deploy b/deploy index 08b95d0..fcd6f85 100755 --- a/deploy +++ b/deploy @@ -9,6 +9,7 @@ Options: -f, --fresh Remove old content in the nixstore (good for debugging) -b, --bootloader Reinstall the bootloader -r, --remote Locally build and remotely deploy Colmena hive + --show-trace Show nix stack trace on error -h, --help Show this message (^_^)" # delete all cached entries @@ -31,7 +32,7 @@ rebuild_flake () { # LOG="$(mktemp /tmp/rebuild-XXXXXXXX)" LOG="./rebuild.log" echo "[*] Logging to $LOG" - sudo nixos-rebuild switch --flake . $FLAGS 2>&1 | tee "$LOG" + sudo nixos-rebuild switch --flake . $FLAGS $EXTRA_FLAGS 2>&1 | tee "$LOG" #nixos-rebuild build --flake .# --cores 8 -j 1 } @@ -42,19 +43,22 @@ deploy_hive () { git add . --verbose # Deploy to all Colmena hives - colmena build --experimental-flake-eval - colmena apply --experimental-flake-eval + colmena build --experimental-flake-eval $EXTRA_FLAGS + colmena apply --experimental-flake-eval $EXTRA_FLAGS # colmena apply --on hyrule --experimental-flake-eval } # check which flags were given flag_fresh=false flag_bootloader=false +flag_remote=false +flag_trace=false for flag in "$@"; do case "$flag" in -r|--remote) - deploy_hive - exit 0 ;; + flag_remote=true ;; + --show-trace) + flag_trace=true ;; -f|--fresh) flag_fresh=true ;; -b|--bootloader) @@ -68,6 +72,16 @@ for flag in "$@"; do esac done +EXTRA_FLAGS="" +if [ "$flag_trace" = true ]; then + EXTRA_FLAGS="$EXTRA_FLAGS --show-trace" +fi + +if [ "$flag_remote" = true ]; then + deploy_hive + exit 0 +fi + # delete cached items in nixstore if [ "$flag_fresh" = true ]; then collect_garbage