fetchurl: restructure with lib.extendMkDerivation (not formatted)

This commit is contained in:
Yueh-Shun Li
2025-10-28 06:38:45 +08:00
parent 089fab12e3
commit bf3e7097f3
+27 -3
View File
@@ -53,6 +53,28 @@ let
in
lib.extendMkDerivation {
constructDrv = stdenvNoCC.mkDerivation;
excludeDrvArgNames = [
# Passed via passthru
"url"
# Name-related attributes
# TODO(@ShamrockLee): Pass them.
"name"
"pname"
"version"
# Hash attributes will be map to the corresponding outputHash*
"hash"
"sha1"
"sha256"
"sha512"
];
extendDrvArgs =
finalAttrs:
{
# URL to fetch.
url ? "",
@@ -212,7 +234,6 @@ let
"${lib.head mirrorList}${lib.elemAt mirrorSplit 1}";
in
stdenvNoCC.mkDerivation (
(
if (pname != "" && version != "") then
{ inherit pname version; }
@@ -307,5 +328,8 @@ stdenvNoCC.mkDerivation (
inherit url resolvedUrl;
}
// passthru;
}
)
};
# No ellipsis
inheritFunctionArgs = false;
}