From 45fc1f185f6b74884d50dbf17bd044aa22eb3069 Mon Sep 17 00:00:00 2001 From: figsoda Date: Sat, 7 Jan 2023 17:53:21 -0500 Subject: [PATCH] rustPlatform.fetchCargoTarball: default outputHashAlgo to sha256 --- pkgs/build-support/rust/fetch-cargo-tarball/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/rust/fetch-cargo-tarball/default.nix b/pkgs/build-support/rust/fetch-cargo-tarball/default.nix index 6d6219078bac..7ca306b613bc 100644 --- a/pkgs/build-support/rust/fetch-cargo-tarball/default.nix +++ b/pkgs/build-support/rust/fetch-cargo-tarball/default.nix @@ -28,7 +28,11 @@ in } @ args: let hash_ = - if args ? hash then { outputHashAlgo = null; outputHash = args.hash; } + if args ? hash then + { + outputHashAlgo = if args.hash == "" then "sha256" else null; + outputHash = args.hash; + } else if args ? sha256 then { outputHashAlgo = "sha256"; outputHash = args.sha256; } else throw "fetchCargoTarball requires a hash for ${name}"; in stdenv.mkDerivation ({