From f2e9046de511473744c394d5dbfb54ec678e0ce4 Mon Sep 17 00:00:00 2001
From: Matthew Bauer <mjbauer95@gmail.com>
Date: Tue, 9 Jun 2020 01:37:10 -0500
Subject: [PATCH] fetchurl: allow empty hash

Meant as a companion to https://github.com/NixOS/nix/pull/3674

This just resets outputHash if nothing is passed in.
---
 pkgs/build-support/fetchurl/default.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix
index a0c48468dfa..39ec5bf5f2c 100644
--- a/pkgs/build-support/fetchurl/default.nix
+++ b/pkgs/build-support/fetchurl/default.nix
@@ -112,7 +112,7 @@ let
     else if sha512 != "" then { outputHashAlgo = "sha512"; outputHash = sha512; }
     else if sha256 != "" then { outputHashAlgo = "sha256"; outputHash = sha256; }
     else if sha1   != "" then { outputHashAlgo = "sha1";   outputHash = sha1; }
-    else throw "fetchurl requires a hash for fixed-output derivation: ${lib.concatStringsSep ", " urls_}";
+    else { outputHashAlgo = "sha256"; outputHash = ""; };
 in
 
 stdenvNoCC.mkDerivation {