From 839c9e9344e8dc9f22f7562c8b0a3cb178eb5048 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 2 Dec 2019 21:08:16 +0000 Subject: [PATCH] rustPlatform: forward fetchcargo args to stdenv Most stdenv wrappers already work like this -- it allows greater customisation. We just have to be careful to remove arguments we're using that shouldn't be passed to stdenv. I've been conservative here, because fetchcargo checksums shouldn't change lightly. --- pkgs/build-support/rust/fetchcargo.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/rust/fetchcargo.nix b/pkgs/build-support/rust/fetchcargo.nix index a515ce9c6eb5..01e410c8bf8e 100644 --- a/pkgs/build-support/rust/fetchcargo.nix +++ b/pkgs/build-support/rust/fetchcargo.nix @@ -26,11 +26,11 @@ in , cargoUpdateHook ? "" , # whenever to also include the Cargo.lock in the output copyLockfile ? false -}: -stdenv.mkDerivation { +, ... +} @ args: +stdenv.mkDerivation ({ name = "${name}-vendor"; nativeBuildInputs = [ cacert git cargo-vendor-normalise cargo ]; - inherit src srcs patches sourceRoot; phases = "unpackPhase patchPhase installPhase"; @@ -76,4 +76,6 @@ stdenv.mkDerivation { impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars; preferLocalBuild = true; -} +} // (builtins.removeAttrs args [ + "name" "sha256" "cargoUpdateHook" "copyLockfile" +]))