summary refs log tree commit diff
path: root/pkgs/top-level/all-packages.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/top-level/all-packages.nix')
-rw-r--r--pkgs/top-level/all-packages.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 34dd2be42c403..3184cacb4d84a 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -78,9 +78,16 @@ rec {
 
   ### BUILD SUPPORT
 
-  fetchurl = (import ../build-support/fetchurl) {
-    inherit stdenv curl;
-  };
+  /**
+   * Allow the stdenv to determine fetchurl, to cater for strange requirements.
+   */
+  fetchurl =
+    if stdenv ? fetchurl then
+      stdenv.fetchurl
+    else
+      (import ../build-support/fetchurl) {
+        inherit stdenv curl;
+      };
 
   fetchsvn = (import ../build-support/fetchsvn) {
     inherit stdenv subversion nix openssh;