fetchurl: use __structuredAttrs = true and pass curlOptsList directly

This commit is contained in:
Yueh-Shun Li
2025-11-24 06:11:56 +08:00
parent 4535777468
commit cd13136f03
2 changed files with 7 additions and 4 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
source "$NIX_ATTRS_SH_FILE"
source $mirrorsFile
curlVersion=$(curl -V | head -1 | cut -d' ' -f2)
@@ -22,10 +23,10 @@ if ! [ -f "$SSL_CERT_FILE" ]; then
curl+=(--insecure)
fi
eval "curl+=($curlOptsList)"
curl+=("${curlOptsList[@]}")
curl+=(
$curlOpts
${curlOpts[*]}
$NIX_CURL_FLAGS
)
+4 -2
View File
@@ -136,6 +136,7 @@ lib.extendMkDerivation {
# Passthru information, if any.
passthru ? { },
# Doing the download on a remote machine just duplicates network
# traffic, so don't do that by default
preferLocalBuild ? true,
@@ -238,6 +239,8 @@ lib.extendMkDerivation {
derivationArgs
// {
__structuredAttrs = true;
name =
if finalAttrs.pname or null != null && finalAttrs.version or null != null then
"${finalAttrs.pname}-${finalAttrs.version}"
@@ -297,9 +300,8 @@ lib.extendMkDerivation {
''
) curlOpts;
curlOptsList = lib.escapeShellArgs curlOptsList;
inherit
curlOptsList
downloadToTemp
executable
mirrorsFile