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.
This commit is contained in:
Lluís Batlle i Rossell 2013-01-29 22:11:37 +01:00
parent 0bf70832f4
commit ea6b1d808c

View File

@ -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 =