nixos-rebuild: fix creating ./result symlink for flakes

(cherry picked from commit 531dc2e0f12673cce9cc6ea3dc5fd8bfef39c9bf)
This commit is contained in:
Samuel Gräfenstein 2021-05-23 02:07:03 +02:00 committed by github-actions[bot]
parent 34b9ccb9c8
commit 044a0d06c7
1 changed files with 6 additions and 1 deletions

7
pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh Normal file → Executable file
View File

@ -215,7 +215,12 @@ nixBuild() {
} }
nixFlakeBuild() { 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" nix "${flakeFlags[@]}" build "$@" --out-link "${tmpDir}/result"
readlink -f "${tmpDir}/result" readlink -f "${tmpDir}/result"
else else