Do some let-floating to prevent repeated evaluation of impureEnvVars
This commit is contained in:
parent
50cc5629af
commit
1baf48f087
@ -22,6 +22,21 @@ let
|
|||||||
then builtins.attrNames mirrors
|
then builtins.attrNames mirrors
|
||||||
else [] /* backwards compatibility */;
|
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
|
in
|
||||||
|
|
||||||
{ # URL to fetch.
|
{ # URL to fetch.
|
||||||
@ -83,23 +98,8 @@ stdenv.mkDerivation {
|
|||||||
if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
|
if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
|
||||||
outputHash = if outputHash != "" then outputHash else
|
outputHash = if outputHash != "" then outputHash else
|
||||||
if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
|
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
|
inherit showURLs mirrorsFile impureEnvVars;
|
||||||
"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;
|
|
||||||
|
|
||||||
# Doing the download on a remote machine just duplicates network
|
# Doing the download on a remote machine just duplicates network
|
||||||
# traffic, so don't do that.
|
# traffic, so don't do that.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user