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
|
||||
, pname ? null
|
||||
, version
|
||||
, unpack ? true
|
||||
, ...
|
||||
} @ args:
|
||||
|
||||
assert pname == null || pname == crateName;
|
||||
|
||||
fetchzip ({
|
||||
(if unpack then fetchzip else fetchurl) ({
|
||||
name = "${crateName}-${version}.tar.gz";
|
||||
url = "https://crates.io/api/v1/crates/${crateName}/${version}/download";
|
||||
} // lib.optionalAttrs unpack {
|
||||
extension = "tar.gz";
|
||||
} // removeAttrs args [ "crateName" "pname" "version" ])
|
||||
} // removeAttrs args [ "crateName" "pname" "version" "unpack" ])
|
||||
|
Loading…
Reference in New Issue
Block a user