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

(cherry picked from commit 531dc2e0f12673cce9cc6ea3dc5fd8bfef39c9bf)
This commit is contained in:
Samuel Gräfenstein
2021-06-15 15:21:24 +00:00
committed by github-actions[bot]
parent 34b9ccb9c8
commit 044a0d06c7
+6 -1
View File
@@ -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