summary refs log tree commit diff
path: root/pkgs/lib/misc.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-13 18:26:19 -0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-13 18:26:19 -0400
commit4f7917ac62bb27543053056a6e4a3288ecb1809f (patch)
tree3d0168be9f7581b59910f6a508400f2e47fa98c2 /pkgs/lib/misc.nix
parent8225460f8222a5dab662f66f26c7dd8f22883ac4 (diff)
downloadnixpkgs-4f7917ac62bb27543053056a6e4a3288ecb1809f.tar
nixpkgs-4f7917ac62bb27543053056a6e4a3288ecb1809f.tar.gz
nixpkgs-4f7917ac62bb27543053056a6e4a3288ecb1809f.tar.bz2
nixpkgs-4f7917ac62bb27543053056a6e4a3288ecb1809f.tar.lz
nixpkgs-4f7917ac62bb27543053056a6e4a3288ecb1809f.tar.xz
nixpkgs-4f7917ac62bb27543053056a6e4a3288ecb1809f.tar.zst
nixpkgs-4f7917ac62bb27543053056a6e4a3288ecb1809f.zip
Remove obsolete flattenAttrs function
Diffstat (limited to 'pkgs/lib/misc.nix')
-rw-r--r--pkgs/lib/misc.nix6
1 files changed, 1 insertions, 5 deletions
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