1 # This file chooses a sane default stdenv given the system, platform, etc.
3 # Rather than returning a stdenv, this returns a list of functions---one per
4 # each bootstrapping stage. See `./booter.nix` for exactly what this list should
7 { # Args just for stdenvs' usage
9 # Args to pass on to the pkgset builder, too
10 , localSystem, crossSystem, config, overlays, crossOverlays ? []
14 # The native (i.e., impure) build environment. This one uses the
15 # tools installed on the system outside of the Nix environment,
16 # i.e., the stuff in /bin, /usr/bin, etc. This environment should
17 # be used with care, since many Nix packages will not build properly
18 # with it (e.g., because they require GNU Make).
19 stagesNative = import ./native args;
21 # The Nix build environment.
22 stagesNix = import ./nix (args // { bootStages = stagesNative; });
24 stagesFreeBSD = import ./freebsd args;
26 # On Linux systems, the standard build environment consists of Nix-built
27 # instances glibc and the `standard' Unix tools, i.e., the Posix utilities,
28 # the GNU C compiler, and so on.
29 stagesLinux = import ./linux args;
31 stagesDarwin = import ./darwin args;
33 stagesCross = import ./cross args;
35 stagesCustom = import ./custom args;
37 # Select the appropriate stages for the platform `system'.
39 if crossSystem != localSystem || crossOverlays != [] then stagesCross
40 else if config ? replaceStdenv then stagesCustom
41 else if localSystem.isLinux then stagesLinux
42 else if localSystem.isDarwin then stagesDarwin
43 else # misc special cases
45 x86_64-solaris = stagesNix;
46 i686-cygwin = stagesNative;
47 x86_64-cygwin = stagesNative;
48 x86_64-freebsd = stagesFreeBSD;
49 }.${localSystem.system} or stagesNative