Merge pull request #288610 from sephii/nixos-rebuild-remote-specialisation

nixos-rebuild: fix --specialisation with remote builder and target
This commit is contained in:
Sandro 2024-04-20 21:11:35 +02:00 committed by GitHub
commit 65b10c53d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -793,7 +793,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