allow { pkgs, pkgsOrig, ... } : in config.nix
svn path=/nixpkgs/trunk/; revision=14700
This commit is contained in:
parent
5b89240b84
commit
e1c1ecf33a
@ -49,12 +49,19 @@ let
|
|||||||
homeDir = getEnv "HOME";
|
homeDir = getEnv "HOME";
|
||||||
configFile2 = homeDir + "/.nixpkgs/config.nix";
|
configFile2 = homeDir + "/.nixpkgs/config.nix";
|
||||||
|
|
||||||
body =
|
configExpr =
|
||||||
if configFile != "" && pathExists configFile
|
if configFile != "" && pathExists configFile
|
||||||
then import (toPath configFile)
|
then import (toPath configFile)
|
||||||
else if homeDir != "" && pathExists configFile2
|
else if homeDir != "" && pathExists configFile2
|
||||||
then import (toPath configFile2)
|
then import (toPath configFile2)
|
||||||
else {};
|
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
|
# Return an attribute from the Nixpkgs configuration file, or
|
||||||
|
Loading…
x
Reference in New Issue
Block a user