about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/default.nix3
-rw-r--r--lib/fetchers.nix12
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 56e002ddc589..cb9a9b0bd4d0 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -31,6 +31,7 @@ let
 
   # domain-specific
   sandbox = import ./sandbox.nix;
+  fetchers = import ./fetchers.nix;
 
 in
   { inherit trivial
@@ -39,7 +40,7 @@ in
             modules options types
             licenses platforms systems
             debug misc
-            sandbox;
+            sandbox fetchers;
   }
   # !!! don't include everything at top-level; perhaps only the most
   # commonly used functions.
diff --git a/lib/fetchers.nix b/lib/fetchers.nix
new file mode 100644
index 000000000000..19d89d6c4074
--- /dev/null
+++ b/lib/fetchers.nix
@@ -0,0 +1,12 @@
+# snippets that can be shared by mutliple fetchers (pkgs/build-support)
+{
+
+  proxyImpureEnvVars = [
+    # 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"
+  ];
+
+}