1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

Merge pull request #544 from PhotonQuantum/fix-darwin-rebuild

Fix darwin rebuild fails with flake and dry-run
This commit is contained in:
Domen Kožar 2022-11-02 20:11:24 +00:00 committed by GitHub
commit cfc0125eaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,6 +19,7 @@ showSyntax() {
# Parse the command line.
origArgs=("$@")
extraMetadataFlags=()
extraBuildFlags=()
extraLockFlags=()
extraProfileFlags=()
@ -35,7 +36,11 @@ while [ $# -gt 0 ]; do
edit|switch|activate|build|check|changelog)
action=$i
;;
--show-trace|--no-build-hook|--dry-run|--keep-going|-k|--keep-failed|-K|--verbose|-v|-vv|-vvv|-vvvv|-vvvvv|--fallback|-Q)
--show-trace|--keep-going|--keep-failed|--verbose|-v|-vv|-vvv|-vvvv|-vvvvv|--fallback)
extraMetadataFlags+=("$i")
extraBuildFlags+=("$i")
;;
--no-build-hook|--dry-run|-k|-K|-Q)
extraBuildFlags+=("$i")
;;
-j[0-9]*)
@ -57,6 +62,7 @@ while [ $# -gt 0 ]; do
j=$1
k=$2
shift 2
extraMetadataFlags+=("$i" "$j" "$k")
extraBuildFlags+=("$i" "$j" "$k")
;;
--flake)
@ -132,7 +138,7 @@ if [ -n "$flake" ]; then
cmd=info
fi
flake=$(nix "${flakeFlags[@]}" flake "$cmd" --json "${extraBuildFlags[@]}" "${extraLockFlags[@]}" -- "$flake" | jq -r .url)
flake=$(nix "${flakeFlags[@]}" flake "$cmd" --json "${extraMetadataFlags[@]}" "${extraLockFlags[@]}" -- "$flake" | jq -r .url)
fi
if [ "$action" != build ] && [ -z "$flake" ]; then