depot/third_party/nixpkgs/pkgs/build-support/rust/fetchcrate.nix
Default email a66bca1520 Project import generated by Copybara.
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
2022-12-17 11:02:37 +01:00

15 lines
344 B
Nix

{ lib, fetchzip }:
{ crateName ? args.pname
, pname ? null
, version
, ...
} @ args:
assert pname == null || pname == crateName;
fetchzip ({
name = "${crateName}-${version}.tar.gz";
url = "https://crates.io/api/v1/crates/${crateName}/${version}/download";
extension = "tar.gz";
} // removeAttrs args [ "crateName" "pname" "version" ])