From 08bfa73e741c07f61c328b5c636e30f591c8ce9f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 9 May 2026 15:00:10 +0000 Subject: [PATCH] fix: detect switchInhibitors from captured nixos-rebuild output Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/637e0a15-b70f-44b0-abe8-8ba3dd25a359 Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> --- modules/core/sovran-hub.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/core/sovran-hub.nix b/modules/core/sovran-hub.nix index 4d7cc3e..565c68f 100644 --- a/modules/core/sovran-hub.nix +++ b/modules/core/sovran-hub.nix @@ -146,9 +146,12 @@ let if [ "$RC" -eq 0 ]; then echo "── Step 2/3: nixos-rebuild ──────────────────────────" - if nixos-rebuild switch --flake /etc/nixos --print-build-logs 2>&1; then + SWITCH_OUT=$(nixos-rebuild switch --flake /etc/nixos --print-build-logs 2>&1) + SWITCH_RC=$? + echo "$SWITCH_OUT" + if [ "$SWITCH_RC" -eq 0 ]; then echo "[OK] switch succeeded" - elif grep -q "switchInhibitors\|Pre-switch checks failed" "$LOG" 2>/dev/null; then + elif echo "$SWITCH_OUT" | grep -q "switchInhibitors\|Pre-switch checks failed"; then echo "" echo " ✓ Build succeeded — a reboot is required to apply this update" echo " (Critical system components changed; running nixos-rebuild boot instead)" @@ -206,13 +209,16 @@ let echo "══════════════════════════════════════════════════" echo "" echo "── Rebuilding system configuration ──────────────" - if nixos-rebuild switch --flake /etc/nixos --print-build-logs 2>&1; then + SWITCH_OUT=$(nixos-rebuild switch --flake /etc/nixos --print-build-logs 2>&1) + SWITCH_RC=$? + echo "$SWITCH_OUT" + if [ "$SWITCH_RC" -eq 0 ]; then echo "" echo "══════════════════════════════════════════════════" echo " ✓ Rebuild completed successfully" echo "══════════════════════════════════════════════════" echo "SUCCESS" > "$STATUS" - elif grep -q "switchInhibitors\|Pre-switch checks failed" "$LOG" 2>/dev/null; then + elif echo "$SWITCH_OUT" | grep -q "switchInhibitors\|Pre-switch checks failed"; then echo "" echo " ✓ Build succeeded — a reboot is required to apply this rebuild" echo " (Critical system components changed; running nixos-rebuild boot instead)"