1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 18:57:08 +00:00

Merge pull request #578 from saccarosium/rebuild-flake-no-out-link

Rebuild flake no out link, like #310 but with latest master
This commit is contained in:
Domen Kožar 2022-12-14 10:56:22 +00:00 committed by GitHub
commit 852f451fee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,8 +141,12 @@ if [ -n "$flake" ]; then
flake=$(nix "${flakeFlags[@]}" flake "$cmd" --json "${extraMetadataFlags[@]}" "${extraLockFlags[@]}" -- "$flake" | jq -r .url)
fi
if [ "$action" != build ] && [ -z "$flake" ]; then
extraBuildFlags+=("--no-out-link")
if [ "$action" != build ]; then
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 '<darwin>' "${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