mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
16 lines
344 B
Nix
16 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" ])
|