2022-12-17 10:02:37 +00:00
|
|
|
{ lib, fetchzip }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
{ crateName ? args.pname
|
|
|
|
, pname ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
, version
|
2022-12-17 10:02:37 +00:00
|
|
|
, ...
|
|
|
|
} @ args:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
assert pname == null || pname == crateName;
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
fetchzip ({
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "${crateName}-${version}.tar.gz";
|
|
|
|
url = "https://crates.io/api/v1/crates/${crateName}/${version}/download";
|
2022-12-17 10:02:37 +00:00
|
|
|
extension = "tar.gz";
|
|
|
|
} // removeAttrs args [ "crateName" "pname" "version" ])
|