diff --git a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh old mode 100644 new mode 100755 index 2b94f18f538..890c070a27a --- a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh +++ b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh @@ -215,7 +215,12 @@ nixBuild() { } nixFlakeBuild() { - if [ -z "$buildHost" ]; then + if [[ -z "$buildHost" && -z "$targetHost" ]] && + ! [ "$action" = switch -o "$action" = boot ] + then + nix "${flakeFlags[@]}" build "$@" + readlink -f ./result + elif [ -z "$buildHost" ]; then nix "${flakeFlags[@]}" build "$@" --out-link "${tmpDir}/result" readlink -f "${tmpDir}/result" else