mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 14:22:50 +03:00
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";
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user