diff options
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/rust/fetch-cargo-tarball/default.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/build-support/rust/fetch-cargo-tarball/default.nix b/pkgs/build-support/rust/fetch-cargo-tarball/default.nix index 6d6219078bacb..7ca306b613bcd 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 ({ |