1{
2 lib,
3 crossSystem,
4 localSystem,
5 config,
6 overlays,
7 bootStages,
8 ...
9}:
10
11assert crossSystem == localSystem;
12
13bootStages
14++ [
15 (prevStage: {
16 inherit config overlays;
17
18 stdenv = import ../generic rec {
19 inherit config;
20
21 inherit (prevStage.stdenv) buildPlatform hostPlatform targetPlatform;
22
23 preHook = ''
24 export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}"
25 export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}"
26 export NIX_IGNORE_LD_THROUGH_GCC=1
27 '';
28
29 initialPath = (import ../generic/common-path.nix) { pkgs = prevStage; };
30
31 cc = import ../../build-support/cc-wrapper {
32 inherit lib;
33 nativeTools = false;
34 nativePrefix = lib.optionalString hostPlatform.isSunOS "/usr";
35 nativeLibc = true;
36 inherit (prevStage)
37 stdenvNoCC
38 binutils
39 coreutils
40 gnugrep
41 ;
42 cc = prevStage.gcc.cc;
43 isGNU = true;
44 shell = prevStage.bash + "/bin/sh";
45 };
46
47 shell = prevStage.bash + "/bin/sh";
48
49 fetchurlBoot = prevStage.stdenv.fetchurlBoot;
50
51 overrides = self: super: {
52 inherit cc;
53 inherit (cc) binutils;
54 inherit (prevStage)
55 gzip
56 bzip2
57 xz
58 bash
59 coreutils
60 diffutils
61 findutils
62 gawk
63 gnumake
64 gnused
65 gnutar
66 gnugrep
67 gnupatch
68 perl
69 ;
70 };
71 };
72 })
73]