scripts/deploy: fix invalid use of "failed" builtin

This commit is contained in:
2025-05-15 15:32:28 +00:00
parent 098a5ac959
commit 1c739bd8ad

View File

@@ -252,14 +252,18 @@ proc deployOneHost (; host, variant) {
switch | test { switch | test {
info "activating profile... " info "activating profile... "
destructive runOnTarget "$netHost" sudo nix-env -p /nix/var/nix/profiles/system --set "$myStorePath" destructive runOnTarget "$netHost" sudo nix-env -p /nix/var/nix/profiles/system --set "$myStorePath"
try { try {
destructive runOnTarget "$netHost" sudo "$myStorePath/bin/switch-to-configuration" "$action" destructive runOnTarget "$netHost" sudo "$myStorePath/bin/switch-to-configuration" "$action"
} }
var fail = failed var fail = false
if failed { setvar fail = true } # XXX: `failed` special variable is only readable via `if failed`
if (doReboot and (not fail or doRebootForce)) { if (doReboot and (not fail or doRebootForce)) {
info "rebooting $host" info "rebooting $host"
destructive runOnTarget "$netHost" sane-reboot "$host" || return 1 destructive runOnTarget "$netHost" sane-reboot "$host" || return 1
} }
if (fail) { if (fail) {
false false
} }