diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2007-09-11 15:00:49 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2007-09-11 15:00:49 +0000 |
commit | 76a8d120a41c2631688f42cc2cab0b225210bc8e (patch) | |
tree | 2604213646e954820ff3d98e902f8c702bac6683 /pkgs/build-support/fetchurl/default.nix | |
parent | 6c4fd2e3df5124dd625711135d82e39f2220d7e3 (diff) | |
download | nixpkgs-76a8d120a41c2631688f42cc2cab0b225210bc8e.tar nixpkgs-76a8d120a41c2631688f42cc2cab0b225210bc8e.tar.gz nixpkgs-76a8d120a41c2631688f42cc2cab0b225210bc8e.tar.bz2 nixpkgs-76a8d120a41c2631688f42cc2cab0b225210bc8e.tar.lz nixpkgs-76a8d120a41c2631688f42cc2cab0b225210bc8e.tar.xz nixpkgs-76a8d120a41c2631688f42cc2cab0b225210bc8e.tar.zst nixpkgs-76a8d120a41c2631688f42cc2cab0b225210bc8e.zip |
* Allow the user to override the list of mirrors for specific
mirror:// sites through environment variables, e.g. NIX_MIRRORS_gnu="ftp://ftp.nluug.nl/pub/gnu/ ftp://ftp.gnu.org/pub/gnu/" or NIX_MIRRORS_sourceforge="http://surfnet.dl.sourceforge.net/sourceforge/" svn path=/nixpkgs/trunk/; revision=9302
Diffstat (limited to 'pkgs/build-support/fetchurl/default.nix')
-rw-r--r-- | pkgs/build-support/fetchurl/default.nix | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index e752b9313e9..f502b889047 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -28,7 +28,20 @@ assert url != "" -> urls == []; assert (outputHash != "" && outputHashAlgo != "") || md5 != "" || sha1 != "" || sha256 != ""; -let urls_ = if urls != [] then urls else [url]; in +let + + urls_ = if urls != [] then urls else [url]; + + mirrors = import ./mirrors.nix; + + # Names of the master sites that are mirrored (i.e., "sourceforge", + # "gnu", etc.). + sites = + if builtins ? attrNames + then builtins.attrNames mirrors + else [] /* backwards compatibility */; + +in stdenv.mkDerivation ({ name = @@ -62,10 +75,10 @@ stdenv.mkDerivation ({ # This variable allows the user to override hashedMirrors from the # command-line. "NIX_HASHED_MIRRORS" - ]; + ] ++ (map (site: "NIX_MIRRORS_${site}") sites); } # Pass the mirror locations to the builder. -// (import ./mirrors.nix) +// mirrors ) |