From 0a1dcea515a9461453a49946b392c237d98257d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Fri, 3 Sep 2010 21:34:49 +0000 Subject: [PATCH] Changing the way 'platform' gets into all-packages, allowing setting it in nixpkgs config. svn path=/nixpkgs/branches/stdenv-updates/; revision=23635 --- pkgs/top-level/all-packages.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3feaf7d5503..8f4adbb1082 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -32,11 +32,11 @@ config ? null , crossSystem ? null -, platform ? (import ./platforms.nix).pc +, platform ? null }: -let config_ = config; in # rename the function argument +let config_ = config; platform_ = platform; in # rename the function arguments let @@ -70,6 +70,10 @@ let then configExpr { inherit pkgs pkgsOrig; } 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 getConfig [ "platform" ] (import ./platforms.nix).pc; + # Return an attribute from the Nixpkgs configuration file, or # a default value if the attribute doesn't exist. getConfig = attrPath: default: lib.attrByPath attrPath default config;