mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-20 00:53:12 +03:00
Merge pull request #221104 from figsoda/crate
This commit is contained in:
commit
1792c4f8c7
@ -1,15 +1,17 @@
|
|||||||
{ lib, fetchzip }:
|
{ lib, fetchzip, fetchurl }:
|
||||||
|
|
||||||
{ crateName ? args.pname
|
{ crateName ? args.pname
|
||||||
, pname ? null
|
, pname ? null
|
||||||
, version
|
, version
|
||||||
|
, unpack ? true
|
||||||
, ...
|
, ...
|
||||||
} @ args:
|
} @ args:
|
||||||
|
|
||||||
assert pname == null || pname == crateName;
|
assert pname == null || pname == crateName;
|
||||||
|
|
||||||
fetchzip ({
|
(if unpack then fetchzip else fetchurl) ({
|
||||||
name = "${crateName}-${version}.tar.gz";
|
name = "${crateName}-${version}.tar.gz";
|
||||||
url = "https://crates.io/api/v1/crates/${crateName}/${version}/download";
|
url = "https://crates.io/api/v1/crates/${crateName}/${version}/download";
|
||||||
|
} // lib.optionalAttrs unpack {
|
||||||
extension = "tar.gz";
|
extension = "tar.gz";
|
||||||
} // removeAttrs args [ "crateName" "pname" "version" ])
|
} // removeAttrs args [ "crateName" "pname" "version" "unpack" ])
|
||||||
|
Loading…
Reference in New Issue
Block a user