From 2073159c7c090176ef1c07b818e0e50b70a9f7bf Mon Sep 17 00:00:00 2001 From: Sizhe Zhao Date: Fri, 19 Dec 2025 14:28:52 +0800 Subject: [PATCH] buildRustPackage: use cargoHash from finalAttrs --- pkgs/build-support/rust/build-rust-package/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index 7ad39a58935c7..2ec8204d30843 100644 --- a/pkgs/build-support/rust/build-rust-package/default.nix +++ b/pkgs/build-support/rust/build-rust-package/default.nix @@ -62,6 +62,7 @@ lib.extendMkDerivation { meta ? { }, useFetchCargoVendor ? true, cargoDeps ? null, + cargoHash ? null, cargoLock ? null, cargoVendorDir ? null, checkType ? buildType, @@ -108,7 +109,7 @@ lib.extendMkDerivation { cargoDeps else if cargoLock != null then importCargoLock cargoLock - else if args.cargoHash or null == null then + else if finalAttrs.cargoHash == null then throw "cargoHash, cargoVendorDir, cargoDeps, or cargoLock must be set" else fetchCargoVendor ( @@ -124,11 +125,14 @@ lib.extendMkDerivation { ; name = cargoDepsName; patches = cargoPatches; - hash = args.cargoHash; + hash = finalAttrs.cargoHash; } // depsExtraArgs ); - inherit buildAndTestSubdir; + inherit + buildAndTestSubdir + cargoHash + ; cargoBuildType = buildType;