diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index 06f96b75ce05c..93abc3b43bb8c 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, @@ -111,7 +112,7 @@ lib.extendMkDerivation { cargoDeps else if cargoLock != null then importCargoLock cargoLock - else if args.cargoHash or null == null then + else if cargoHash == null then throw "cargoHash, cargoVendorDir, cargoDeps, or cargoLock must be set" else fetchCargoVendor ( @@ -127,11 +128,14 @@ lib.extendMkDerivation { ; name = cargoDepsName; patches = cargoPatches; - hash = args.cargoHash; + hash = finalAttrs.cargoHash; } // depsExtraArgs ); - inherit buildAndTestSubdir; + inherit + buildAndTestSubdir + cargoHash + ; cargoBuildType = buildType;