From da843c0dde3462c96f13c69590cf47b87f91df95 Mon Sep 17 00:00:00 2001 From: saccarosium Date: Thu, 8 Dec 2022 09:48:45 +0100 Subject: [PATCH] darwin-rebuild: use `--no-link` for flake builds --- pkgs/nix-tools/darwin-rebuild.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/nix-tools/darwin-rebuild.sh b/pkgs/nix-tools/darwin-rebuild.sh index a57fad7d..bb1c0235 100644 --- a/pkgs/nix-tools/darwin-rebuild.sh +++ b/pkgs/nix-tools/darwin-rebuild.sh @@ -142,7 +142,11 @@ if [ -n "$flake" ]; then fi if [ "$action" != build ] && [ -z "$flake" ]; then - extraBuildFlags+=("--no-out-link") + if [ -n "$flake" ]; then + extraBuildFlags+=("--no-link") + else + extraBuildFlags+=("--no-out-link") + fi fi if [ "$action" = edit ]; then @@ -159,8 +163,10 @@ if [ "$action" = switch ] || [ "$action" = build ] || [ "$action" = check ]; the if [ -z "$flake" ]; then systemConfig="$(nix-build '' "${extraBuildFlags[@]}" -A system)" else - nix "${flakeFlags[@]}" build "$flake#$flakeAttr.system" "${extraBuildFlags[@]}" "${extraLockFlags[@]}" - systemConfig=$(readlink -f result) + systemConfig=$(nix "${flakeFlags[@]}" build --json \ + "${extraBuildFlags[@]}" "${extraLockFlags[@]}" \ + -- "$flake#$flakeAttr.system" \ + | jq -r '.[0].outputs.out') fi fi