Unverified Commit a77bfd0f authored by Sylvain Fankhauser's avatar Sylvain Fankhauser
Browse files

nixos-rebuild: fix --specialisation with remote builder and target

Fixes #286066.
parent b5a19775
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -791,7 +791,13 @@ if [[ "$action" = switch || "$action" = boot || "$action" = test || "$action" =
    else
        cmd+=("$pathToConfig/specialisation/$specialisation/bin/switch-to-configuration")

        if [[ ! -f "${cmd[-1]}" ]]; then
        if [ -z "$targetHost" ]; then
            specialisationExists=$(test -f "${cmd[-1]}")
        else
            specialisationExists=$(targetHostCmd test -f "${cmd[-1]}")
        fi

        if ! $specialisationExists; then
            log "error: specialisation not found: $specialisation"
            exit 1
        fi