make-nuget-deps: support an url field in fetchNuGet

If a package source defines an url field, use it instead of the
url based on package name and version, which assumes nuget.org as
a package source.
This commit is contained in:
mdarocha 2022-06-17 11:56:34 +02:00
parent 2f07f578b2
commit c277bd86a5

View File

@ -1,9 +1,10 @@
{ linkFarmFromDrvs, fetchurl }:
{ name, nugetDeps }:
linkFarmFromDrvs "${name}-nuget-deps" (nugetDeps {
fetchNuGet = { pname, version, sha256 }: fetchurl {
linkFarmFromDrvs "${name}-nuget-deps" (nugetDeps {
fetchNuGet = { pname, version, sha256
, url ? "https://www.nuget.org/api/v2/package/${pname}/${version}" }:
fetchurl {
name = "${pname}-${version}.nupkg";
url = "https://www.nuget.org/api/v2/package/${pname}/${version}";
inherit sha256;
inherit url sha256;
};
})
})