diff options
Diffstat (limited to 'pkgs/build-support/fetchurl/default.nix')
-rw-r--r-- | pkgs/build-support/fetchurl/default.nix | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index ec3d45e652e8..cc59dd7fab1e 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -22,6 +22,21 @@ let then builtins.attrNames mirrors else [] /* backwards compatibility */; + impureEnvVars = [ + # We borrow these environment variables from the caller to allow + # easy proxy configuration. This is impure, but a fixed-output + # derivation like fetchurl is allowed to do so since its result is + # 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" + ] ++ (map (site: "NIX_MIRRORS_${site}") sites); + in { # URL to fetch. @@ -83,23 +98,8 @@ stdenv.mkDerivation { if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5"; outputHash = if outputHash != "" then outputHash else if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5; - - impureEnvVars = [ - # We borrow these environment variables from the caller to allow - # easy proxy configuration. This is impure, but a fixed-output - # derivation like fetchurl is allowed to do so since its result is - # 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" - ] ++ (map (site: "NIX_MIRRORS_${site}") sites); - inherit showURLs mirrorsFile; + inherit showURLs mirrorsFile impureEnvVars; # Doing the download on a remote machine just duplicates network # traffic, so don't do that. |