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
|
||||
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.
|
||||
@ -84,22 +99,7 @@ stdenv.mkDerivation {
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user