diff options
author | John Ericson <Ericson2314@Yahoo.com> | 2016-11-26 15:13:43 -0800 |
---|---|---|
committer | John Ericson <jericson@galois.com> | 2016-12-01 11:24:32 -0500 |
commit | 05c12f147e932c990f4b026b9efe0b7a1985461e (patch) | |
tree | a022f4a30b99b64def696f669643e10a8b44cd8e /pkgs/top-level/default.nix | |
parent | 39753f5360134f1aab1a949260374a876c0983eb (diff) | |
download | nixpkgs-05c12f147e932c990f4b026b9efe0b7a1985461e.tar nixpkgs-05c12f147e932c990f4b026b9efe0b7a1985461e.tar.gz nixpkgs-05c12f147e932c990f4b026b9efe0b7a1985461e.tar.bz2 nixpkgs-05c12f147e932c990f4b026b9efe0b7a1985461e.tar.lz nixpkgs-05c12f147e932c990f4b026b9efe0b7a1985461e.tar.xz nixpkgs-05c12f147e932c990f4b026b9efe0b7a1985461e.tar.zst nixpkgs-05c12f147e932c990f4b026b9efe0b7a1985461e.zip |
top-level: Move default-choosing logic to top-level/platforms.nix
This mirrors stdenv/default.nix
Diffstat (limited to 'pkgs/top-level/default.nix')
-rw-r--r-- | pkgs/top-level/default.nix | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/pkgs/top-level/default.nix b/pkgs/top-level/default.nix index 9464a8012b3..6b61110f1e7 100644 --- a/pkgs/top-level/default.nix +++ b/pkgs/top-level/default.nix @@ -24,12 +24,11 @@ config ? {} , crossSystem ? null -, platform ? null +, platform ? assert false; null } @ args: let # Rename the function arguments configExpr = config; - platform_ = platform; in let lib = import ../../lib; @@ -42,21 +41,12 @@ in let then configExpr { inherit pkgs; } else configExpr; - # Allow setting the platform in the config file. Otherwise, let's use a reasonable default (pc) - - platformAuto = let - platforms = (import ./platforms.nix); - in - if system == "armv6l-linux" then platforms.raspberrypi - else if system == "armv7l-linux" then platforms.armv7l-hf-multiplatform - else if system == "armv5tel-linux" then platforms.sheevaplug - else if system == "mips64el-linux" then platforms.fuloong2f_n32 - else if system == "x86_64-linux" then platforms.pc64 - else if system == "i686-linux" then platforms.pc32 - else platforms.pcBase; - - platform = if platform_ != null then platform_ - else config.platform or platformAuto; + # Allow setting the platform in the config file. Otherwise, let's use a + # reasonable default. + platform = + args.platform + or (config.platform + or (import ./platforms.nix).selectPlatformBySystem system); # A few packages make a new package set to draw their dependencies from. # (Currently to get a cross tool chain, or forced-i686 package.) Rather than |