summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/lib/lists.nix2
-rw-r--r--pkgs/lib/misc.nix6
2 files changed, 2 insertions, 6 deletions
diff --git a/pkgs/lib/lists.nix b/pkgs/lib/lists.nix
index e247a27ba16..b50da022283 100644
--- a/pkgs/lib/lists.nix
+++ b/pkgs/lib/lists.nix
@@ -212,7 +212,7 @@ rec {
     let loop = l: if tail l == [] then head l else loop (tail l); in
     loop list;
 
-    
+
   # Zip two lists together.
   zipTwoLists = xs: ys:
     if xs != [] && ys != [] then
diff --git a/pkgs/lib/misc.nix b/pkgs/lib/misc.nix
index f4a629398b5..39a3ad258b0 100644
--- a/pkgs/lib/misc.nix
+++ b/pkgs/lib/misc.nix
@@ -322,10 +322,6 @@ rec {
     // listToAttrs (map (n : nameValuePair n (a: b: "${a}\n${b}") ) [ "preConfigure" "postInstall" ])
   ;
 
-  # returns atribute values as a list 
-  flattenAttrs = set : map ( attr : builtins.getAttr attr set) (attrNames set);
-  mapIf = cond : f :  fold ( x : l : if (cond x) then [(f x)] ++ l else l) [];
-
   # prepareDerivationArgs tries to make writing configurable derivations easier
   # example:
   #  prepareDerivationArgs {
@@ -365,7 +361,7 @@ rec {
         flagName = name : "${name}Support";
         cfgWithDefaults = (listToAttrs (map (n : nameValuePair (flagName n) false) (attrNames args2.flags)))
                           // args2.cfg;
-        opts = flattenAttrs (mapAttrs (a : v :
+        opts = attrValues (mapAttrs (a : v :
                 let v2 = if (v ? set || v ? unset) then v else { set = v; };
                     n = if (getAttr (flagName a) cfgWithDefaults) then "set" else "unset";
                     attr = maybeAttr n {} v2; in