about summary refs log tree commit diff
path: root/pkgs/build-support/fetchurl/default.nix
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2018-12-31 08:10:28 +0100
committerJörg Thalheim <joerg@thalheim.io>2019-01-18 14:41:10 +0000
commiteac6797380af1f0927ab683e2375429826d34e76 (patch)
tree4d292ad4c8eac2df780174bbcbe143802be68de9 /pkgs/build-support/fetchurl/default.nix
parent487d2a7ccdf520e60b77809681e4ca377a7b741d (diff)
downloadnixlib-eac6797380af1f0927ab683e2375429826d34e76.tar
nixlib-eac6797380af1f0927ab683e2375429826d34e76.tar.gz
nixlib-eac6797380af1f0927ab683e2375429826d34e76.tar.bz2
nixlib-eac6797380af1f0927ab683e2375429826d34e76.tar.lz
nixlib-eac6797380af1f0927ab683e2375429826d34e76.tar.xz
nixlib-eac6797380af1f0927ab683e2375429826d34e76.tar.zst
nixlib-eac6797380af1f0927ab683e2375429826d34e76.zip
prefer-fetch-remote: an overlay to fetch on remote builders
This is useful when running tools like NixOps or nix-review
on workstations where the upload to the builder is significantly
slower then downloading the source on the builder itself.
Diffstat (limited to 'pkgs/build-support/fetchurl/default.nix')
-rw-r--r--pkgs/build-support/fetchurl/default.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix
index 5f0c1384c79e..3ce90cbeab3a 100644
--- a/pkgs/build-support/fetchurl/default.nix
+++ b/pkgs/build-support/fetchurl/default.nix
@@ -87,6 +87,9 @@ in
 
   # Passthru information, if any.
 , passthru ? {}
+  # Doing the download on a remote machine just duplicates network
+  # traffic, so don't do that by default
+, preferLocalBuild ? true
 }:
 
 assert sha512 != "" -> builtins.compareVersions "1.11" builtins.nixVersion <= 0;
@@ -135,9 +138,7 @@ stdenvNoCC.mkDerivation {
 
   nixpkgsVersion = lib.trivial.release;
 
-  # Doing the download on a remote machine just duplicates network
-  # traffic, so don't do that.
-  preferLocalBuild = true;
+  inherit preferLocalBuild;
 
   postHook = if netrcPhase == null then null else ''
     ${netrcPhase}