summary refs log tree commit diff
path: root/pkgs/lib/misc.nix
diff options
context:
space:
mode:
authorNicolas Pierron <nicolas.b.pierron@gmail.com>2009-09-15 13:36:30 +0000
committerNicolas Pierron <nicolas.b.pierron@gmail.com>2009-09-15 13:36:30 +0000
commit0c16b00cbd9131fa646ec6b54dff2bd2d2c2ac1a (patch)
tree133376465f776c01b4cc829977aa0398293ea000 /pkgs/lib/misc.nix
parent07ed9e4611c1349aa038ab8da73d04fb8a650c2b (diff)
downloadnixpkgs-0c16b00cbd9131fa646ec6b54dff2bd2d2c2ac1a.tar
nixpkgs-0c16b00cbd9131fa646ec6b54dff2bd2d2c2ac1a.tar.gz
nixpkgs-0c16b00cbd9131fa646ec6b54dff2bd2d2c2ac1a.tar.bz2
nixpkgs-0c16b00cbd9131fa646ec6b54dff2bd2d2c2ac1a.tar.lz
nixpkgs-0c16b00cbd9131fa646ec6b54dff2bd2d2c2ac1a.tar.xz
nixpkgs-0c16b00cbd9131fa646ec6b54dff2bd2d2c2ac1a.tar.zst
nixpkgs-0c16b00cbd9131fa646ec6b54dff2bd2d2c2ac1a.zip
Replace the traversal of modules:
- Remove handleOptionSets which used option declarations & definitions
in the same set.
- Add a traversal of modules where "config" and "options" are traverse at
the same time.

This allow to have accruate error messages with the incriminated files
playing a role in the error.

This system add a new restriction compare to the previous system:
- A module with no structure (option definitions & option declarations
& require) should not contain any option declarations.  If such module
exists you must convert it to the following form:

{ imports = <content of the require attribute>;
  options = <set of option declarations>;
  config = <set of option definitions>;
}

svn path=/nixpkgs/trunk/; revision=17163
Diffstat (limited to 'pkgs/lib/misc.nix')
-rw-r--r--pkgs/lib/misc.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/lib/misc.nix b/pkgs/lib/misc.nix
index 60aecd5aa63..8fe29151976 100644
--- a/pkgs/lib/misc.nix
+++ b/pkgs/lib/misc.nix
@@ -200,14 +200,16 @@ rec {
   # Merge sets of attributes and use the function f to merge
   # attributes values.
   zip = f: sets:
+    zipWithNames (concatMap builtins.attrNames sets) f sets;
+
+  zipWithNames = names: f: sets:
     builtins.listToAttrs (map (name: {
       inherit name;
       value =
         f name
           (map (__getAttr name)
             (filter (__hasAttr name) sets));
-    }) (concatMap builtins.attrNames sets));
-
+    }) names);
 
   lazyGenericClosure = {startSet, operator}:
     let