From 89c72ca6a20bde0b6acaebaa323eee7f1eb0ea14 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sun, 23 Feb 2025 04:59:30 +0800 Subject: [PATCH] buildRustPackage: simplify the cargoDeps specification --- .../rust/build-rust-package/default.nix | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index 421b69fb3488..5d8d0ecc6935 100644 --- a/pkgs/build-support/rust/build-rust-package/default.nix +++ b/pkgs/build-support/rust/build-rust-package/default.nix @@ -72,9 +72,11 @@ lib.extendMkDerivation { ... }@args: - let - - cargoDeps' = + lib.optionalAttrs (stdenv.hostPlatform.isDarwin && buildType == "debug") { + RUSTFLAGS = "-C split-debuginfo=packed " + (args.RUSTFLAGS or ""); + } + // { + cargoDeps = if cargoVendorDir != null then null else if cargoDeps != null then @@ -125,12 +127,6 @@ lib.extendMkDerivation { } // depsExtraArgs ); - in - lib.optionalAttrs (stdenv.hostPlatform.isDarwin && buildType == "debug") { - RUSTFLAGS = "-C split-debuginfo=packed " + (args.RUSTFLAGS or ""); - } - // { - cargoDeps = cargoDeps'; inherit buildAndTestSubdir; cargoBuildType = buildType;