···11-{ lib, stdenvNoCC, curl }: # Note that `curl' may be `null', in case of the native stdenvNoCC.
11+{ lib, buildPackages ? { inherit stdenvNoCC; }, stdenvNoCC, curl }: # Note that `curl' may be `null', in case of the native stdenvNoCC.
2233let
44···1010 # resulting store derivations (.drv files) much smaller, which in
1111 # turn makes nix-env/nix-instantiate faster.
1212 mirrorsFile =
1313- stdenvNoCC.mkDerivation ({
1313+ buildPackages.stdenvNoCC.mkDerivation ({
1414 name = "mirrors-list";
1515 builder = ./write-mirror-list.sh;
1616 preferLocalBuild = true;
+4-2
pkgs/top-level/all-packages.nix
···283283 fetchhg = callPackage ../build-support/fetchhg { };
284284285285 # `fetchurl' downloads a file from the network.
286286- fetchurl = makeOverridable (import ../build-support/fetchurl) {
287287- inherit lib stdenvNoCC;
286286+ fetchurl = if stdenv.buildPlatform != stdenv.hostPlatform
287287+ then buildPackages.fetchurl # No need to do special overrides twice,
288288+ else makeOverridable (import ../build-support/fetchurl) {
289289+ inherit lib stdenvNoCC buildPackages;
288290 curl = buildPackages.curl.override (old: rec {
289291 # break dependency cycles
290292 fetchurl = stdenv.fetchurlBoot;