diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-08-13 18:26:19 -0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-08-13 18:26:19 -0400 |
commit | 4f7917ac62bb27543053056a6e4a3288ecb1809f (patch) | |
tree | 3d0168be9f7581b59910f6a508400f2e47fa98c2 /pkgs | |
parent | 8225460f8222a5dab662f66f26c7dd8f22883ac4 (diff) | |
download | nixlib-4f7917ac62bb27543053056a6e4a3288ecb1809f.tar nixlib-4f7917ac62bb27543053056a6e4a3288ecb1809f.tar.gz nixlib-4f7917ac62bb27543053056a6e4a3288ecb1809f.tar.bz2 nixlib-4f7917ac62bb27543053056a6e4a3288ecb1809f.tar.lz nixlib-4f7917ac62bb27543053056a6e4a3288ecb1809f.tar.xz nixlib-4f7917ac62bb27543053056a6e4a3288ecb1809f.tar.zst nixlib-4f7917ac62bb27543053056a6e4a3288ecb1809f.zip |
Remove obsolete flattenAttrs function
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/lib/lists.nix | 2 | ||||
-rw-r--r-- | pkgs/lib/misc.nix | 6 |
2 files changed, 2 insertions, 6 deletions
diff --git a/pkgs/lib/lists.nix b/pkgs/lib/lists.nix index e247a27ba16d..b50da022283b 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 f4a629398b53..39a3ad258b04 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 |