2022-11-03 16:33:27 +00:00
|
|
|
{ lib, fetchzip }:
|
2017-12-12 10:54:01 +00:00
|
|
|
|
2020-08-26 12:56:19 +00:00
|
|
|
{ crateName ? args.pname
|
|
|
|
, pname ? null
|
2017-12-12 10:54:01 +00:00
|
|
|
, version
|
2022-11-03 16:33:27 +00:00
|
|
|
, ...
|
|
|
|
} @ args:
|
2017-12-12 10:54:01 +00:00
|
|
|
|
2020-08-26 12:56:19 +00:00
|
|
|
assert pname == null || pname == crateName;
|
|
|
|
|
2022-11-03 16:33:27 +00:00
|
|
|
fetchzip ({
|
2017-12-12 10:54:01 +00:00
|
|
|
name = "${crateName}-${version}.tar.gz";
|
|
|
|
url = "https://crates.io/api/v1/crates/${crateName}/${version}/download";
|
2022-11-03 16:33:27 +00:00
|
|
|
extension = "tar.gz";
|
|
|
|
} // removeAttrs args [ "crateName" "pname" "version" ])
|