From e1c1ecf33aa65568890f04f2b6a47f987107cd3a Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Wed, 25 Mar 2009 13:29:47 +0000 Subject: [PATCH] allow { pkgs, pkgsOrig, ... } : in config.nix svn path=/nixpkgs/trunk/; revision=14700 --- pkgs/top-level/all-packages.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 53b791eef58b..c83857100e99 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -49,12 +49,19 @@ let homeDir = getEnv "HOME"; configFile2 = homeDir + "/.nixpkgs/config.nix"; - body = + configExpr = if configFile != "" && pathExists configFile then import (toPath configFile) else if homeDir != "" && pathExists configFile2 then import (toPath configFile2) else {}; + + # allow both: + # { /* the config */ } and + # { pkgsOrig, pkgs, ... } : { /* the config */ } + body = if builtins.isFunction configExpr + then configExpr { inherit pkgs pkgsOrig; } + else configExpr; }; # Return an attribute from the Nixpkgs configuration file, or