From ea6b1d808c55954e7446f469b976d258165c8632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Tue, 29 Jan 2013 22:11:37 +0100 Subject: [PATCH] Adding an automatic proper platform for some systems we know That eases the burden of having to always set the platform at least in the non-pc pure nixpkgs platforms. --- pkgs/top-level/all-packages.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a58ab3471ba..7f9935889fb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -77,9 +77,17 @@ let else configExpr; # Allow setting the platform in the config file. Otherwise, let's use a reasonable default (pc) - platform = if platform_ != null then platform_ - else config.platform or (import ./platforms.nix).pc; + platformAuto = let + platforms = (import ./platforms.nix); + in + if system == "armv6l-linux" then platforms.raspberrypi + else if system == "armv5tel-linux" then platforms.sheevaplug + else if system == "mips64el-linux" then platforms.fuloong2f_n32 + else platforms.pc; + + platform = if platform_ != null then platform_ + else config.platform or platformAuto; # Helper functions that are exported through `pkgs'. helperFunctions =