about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2024-04-20 21:11:35 +0200
committerGitHub <noreply@github.com>2024-04-20 21:11:35 +0200
commit65b10c53d110fb78e1c752ca53dfba1e72746ad1 (patch)
treeb39c8df919a4e181c871fde52c7c8948f4afa719 /pkgs
parent4c187ca71f8fabd9edc701d0755b2aafb318cb61 (diff)
parenta77bfd0f1528be2e885e4c4c8d41e70dfa6bae0d (diff)
Merge pull request #288610 from sephii/nixos-rebuild-remote-specialisation
nixos-rebuild: fix --specialisation with remote builder and target
Diffstat (limited to 'pkgs')
-rwxr-xr-xpkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
index 30a1e4dd8b6f0..67733922f0c02 100755
--- a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
+++ b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh
@@ -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