buildDotNetGlobalTool: add SRI hash support

This commit is contained in:
aleksana 2024-07-04 17:52:24 +08:00
parent 2280d5c467
commit 74597434a7

View File

@ -5,6 +5,8 @@
# Name of the nuget package to install, if different from pname # Name of the nuget package to install, if different from pname
, nugetName ? pname , nugetName ? pname
# Hash of the nuget package to install, will be given on first build # Hash of the nuget package to install, will be given on first build
# nugetHash uses SRI hash and should be preferred
, nugetHash ? ""
, nugetSha256 ? "" , nugetSha256 ? ""
# Additional nuget deps needed by the tool package # Additional nuget deps needed by the tool package
, nugetDeps ? (_: []) , nugetDeps ? (_: [])
@ -24,7 +26,7 @@ buildDotnetModule (args // {
nugetDeps = mkNugetDeps { nugetDeps = mkNugetDeps {
name = pname; name = pname;
nugetDeps = { fetchNuGet }: [ nugetDeps = { fetchNuGet }: [
(fetchNuGet { pname = nugetName; inherit version; sha256 = nugetSha256; }) (fetchNuGet { pname = nugetName; inherit version; sha256 = nugetSha256; hash = nugetHash; })
] ++ (nugetDeps fetchNuGet); ] ++ (nugetDeps fetchNuGet);
}; };