1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-15 17:51:01 +00:00

Back out "Add support for submodules in flakes"

This backs out commit 5452c8c638.
This commit is contained in:
Michael Hoang 2024-11-03 12:01:00 +11:00
parent f203352cc0
commit 406cb56d06

View file

@ -157,19 +157,12 @@ fi
# For convenience, use the hostname as the default configuration to # For convenience, use the hostname as the default configuration to
# build from the flake. # build from the flake.
if [ -n "$flake" ]; then if [[ -n "$flake" ]]; then
# Offical regex from https://www.rfc-editor.org/rfc/rfc3986#appendix-B if [[ $flake =~ ^(.*)\#([^\#\"]*)$ ]]; then
if [[ "${flake}" =~ ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? ]]; then flake="${BASH_REMATCH[1]}"
scheme=${BASH_REMATCH[1]} # eg. http: flakeAttr="${BASH_REMATCH[2]}"
authority=${BASH_REMATCH[3]} # eg. //www.ics.uci.edu
path=${BASH_REMATCH[5]} # eg. /pub/ietf/uri/
queryWithQuestion=${BASH_REMATCH[6]}
fragment=${BASH_REMATCH[9]}
flake=${scheme}${authority}${path}${queryWithQuestion}
flakeAttr=${fragment}
fi fi
if [ -z "$flakeAttr" ]; then if [[ -z "$flakeAttr" ]]; then
flakeAttr=$(scutil --get LocalHostName) flakeAttr=$(scutil --get LocalHostName)
fi fi
flakeAttr=darwinConfigurations.${flakeAttr} flakeAttr=darwinConfigurations.${flakeAttr}
@ -182,16 +175,7 @@ if [ -n "$flake" ]; then
cmd=info cmd=info
fi fi
metadata=$(nix "${flakeFlags[@]}" flake "$cmd" --json "${extraMetadataFlags[@]}" "${extraLockFlags[@]}" -- "$flake") flake=$(nix "${flakeFlags[@]}" flake "$cmd" --json "${extraMetadataFlags[@]}" "${extraLockFlags[@]}" -- "$flake" | jq -r .url)
flake=$(jq -r .url <<<"${metadata}")
if [ "$(jq -r .resolved.submodules <<<"${metadata}")" = "true" ]; then
if [[ "$flake" == *'?'* ]]; then
flake="${flake}&submodules=1"
else
flake="${flake}?submodules=1"
fi
fi
fi fi
if [ "$action" != build ]; then if [ "$action" != build ]; then