about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/build-support/fetchurl/builder.sh4
-rw-r--r--pkgs/build-support/fetchurl/default.nix3
2 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchurl/builder.sh b/pkgs/build-support/fetchurl/builder.sh
index 22ba25e90a4f..1682dc63392d 100644
--- a/pkgs/build-support/fetchurl/builder.sh
+++ b/pkgs/build-support/fetchurl/builder.sh
@@ -13,9 +13,11 @@ fi
 # cryptographic hash of the output anyway). 
 curl="curl \
  --location --max-redirs 20 \
+ --retry 3
  --disable-epsv \
  --cookie-jar cookies \
- --insecure"
+ --insecure \
+ $NIX_CURL_OPTIONS"
 
 
 tryDownload() {
diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix
index 1ba9124027d4..62f6fb2acf4b 100644
--- a/pkgs/build-support/fetchurl/default.nix
+++ b/pkgs/build-support/fetchurl/default.nix
@@ -91,6 +91,9 @@ stdenv.mkDerivation {
     # by definition pure.
     "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy"
 
+    # This variable allows the user to pass additional options to curl
+    "NIX_CURL_FLAGS"
+
     # This variable allows the user to override hashedMirrors from the
     # command-line.
     "NIX_HASHED_MIRRORS"