aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/build-support/rust/fetchcrate.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/build-support/rust/fetchcrate.nix')
-rw-r--r--nixpkgs/pkgs/build-support/rust/fetchcrate.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/build-support/rust/fetchcrate.nix b/nixpkgs/pkgs/build-support/rust/fetchcrate.nix
index 95dfd38b12a..4e6c38b032c 100644
--- a/nixpkgs/pkgs/build-support/rust/fetchcrate.nix
+++ b/nixpkgs/pkgs/build-support/rust/fetchcrate.nix
@@ -1,10 +1,13 @@
{ lib, fetchurl, unzip }:
-{ crateName
+{ crateName ? args.pname
+, pname ? null
, version
, sha256
, ... } @ args:
+assert pname == null || pname == crateName;
+
lib.overrideDerivation (fetchurl ({
name = "${crateName}-${version}.tar.gz";
@@ -30,6 +33,6 @@ lib.overrideDerivation (fetchurl ({
fi
mv "$unpackDir/$fn" "$out"
'';
-} // removeAttrs args [ "crateName" "version" ]))
+} // removeAttrs args [ "crateName" "pname" "version" ]))
# Hackety-hack: we actually need unzip hooks, too
(x: {nativeBuildInputs = x.nativeBuildInputs++ [unzip];})