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

This commit is contained in:
Samuel Gräfenstein
2021-06-15 08:15:31 -07:00
committed by Jonathan Ringer
parent 0e98d7acab
commit ff3b3e696a
+6 -1
View File
@@ -210,7 +210,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