2016-11-02 21:39:18 +01:00
|
|
|
{ system, bootStdenv, crossSystem, config, platform, lib, nixpkgsFun, ... }:
|
|
|
|
pkgs:
|
2016-03-20 16:14:57 +01:00
|
|
|
|
|
|
|
rec {
|
|
|
|
allStdenvs = import ../stdenv {
|
|
|
|
inherit system platform config lib;
|
2016-11-02 21:39:18 +01:00
|
|
|
# TODO(@Ericson2314): hack for cross-compiling until I clean that in follow-up PR
|
|
|
|
allPackages = args: nixpkgsFun (args // { crossSystem = null; });
|
2016-03-20 16:14:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
defaultStdenv = allStdenvs.stdenv // { inherit platform; };
|
|
|
|
|
|
|
|
stdenv =
|
|
|
|
if bootStdenv != null then (bootStdenv // {inherit platform;}) else
|
|
|
|
if crossSystem != null then
|
2016-11-02 21:39:18 +01:00
|
|
|
pkgs.stdenvCross
|
2016-03-20 16:14:57 +01:00
|
|
|
else
|
|
|
|
let
|
|
|
|
changer = config.replaceStdenv or null;
|
|
|
|
in if changer != null then
|
|
|
|
changer {
|
|
|
|
# We import again all-packages to avoid recursivities.
|
2016-11-02 21:39:18 +01:00
|
|
|
pkgs = nixpkgsFun {
|
2016-03-20 16:14:57 +01:00
|
|
|
# We remove packageOverrides to avoid recursivities
|
|
|
|
config = removeAttrs config [ "replaceStdenv" ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
else
|
|
|
|
defaultStdenv;
|
|
|
|
}
|