diff options
author | Nicolas Pierron <nicolas.b.pierron@gmail.com> | 2009-09-28 18:22:49 +0000 |
---|---|---|
committer | Nicolas Pierron <nicolas.b.pierron@gmail.com> | 2009-09-28 18:22:49 +0000 |
commit | 33d43ac18bd9178e5222433f3ef7e58a3a35f173 (patch) | |
tree | 1c29bf0bf2f79fe231f7c8338bd1fe380405f567 /pkgs/lib/modules.nix | |
parent | b3b40ebf791156abba529b2e50678f8958e284c3 (diff) | |
download | nixpkgs-33d43ac18bd9178e5222433f3ef7e58a3a35f173.tar nixpkgs-33d43ac18bd9178e5222433f3ef7e58a3a35f173.tar.gz nixpkgs-33d43ac18bd9178e5222433f3ef7e58a3a35f173.tar.bz2 nixpkgs-33d43ac18bd9178e5222433f3ef7e58a3a35f173.tar.lz nixpkgs-33d43ac18bd9178e5222433f3ef7e58a3a35f173.tar.xz nixpkgs-33d43ac18bd9178e5222433f3ef7e58a3a35f173.tar.zst nixpkgs-33d43ac18bd9178e5222433f3ef7e58a3a35f173.zip |
Add extraConfigs attribute inside options. This attribute is used to
insert definitions from an external location. As opposed to other defintions, these definitions are always embedded into a list which allow to add multiple definitions with one module. !!! This feature _should not_ be used as a new mean to define options. svn path=/nixpkgs/trunk/; revision=17481
Diffstat (limited to 'pkgs/lib/modules.nix')
-rw-r--r-- | pkgs/lib/modules.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/lib/modules.nix b/pkgs/lib/modules.nix index 19b04bd827f..4de12e1a07c 100644 --- a/pkgs/lib/modules.nix +++ b/pkgs/lib/modules.nix @@ -230,10 +230,14 @@ rec { }" ); - config = lib.zipWithNames (modulesNames modules) (name: values: + config = lib.zipWithNames (modulesNames modules) (name: values_: let hasOpt = builtins.hasAttr name result.options; opt = lib.getAttr name result.options; + values = values_ ++ + optionals + (hasOpt && isOption opt && opt ? extraConfigs) + opt.extraConfigs; in if hasOpt && isOption opt then let defs = evalProperties values; in |