query
On this page

mapAttrsRecursiveCond

lib.mapAttrsRecursiveCond

Docs pulled from | This Revision | about 12 hours ago


Like mapAttrsRecursive, but it takes an additional predicate that tells it whether to recurse into an attribute set. If the predicate returns false, mapAttrsRecursiveCond does not recurse, but instead applies the mapping function. If the predicate returns true, it does recurse, and does not apply the mapping function.

Map over an leaf attributes defined by a condition

Map derivations to their name attribute. Derivatons are identified as attribute sets that contain { type = "derivation"; }.

mapAttrsRecursiveCond
  (as: !(as ? "type" && as.type == "derivation"))
  (x: x.name)
  attrs

Type

mapAttrsRecursiveCond :: (AttrSet -> Bool) -> ([String] -> a -> b) -> AttrSet -> AttrSet
(lib.attrsets.mapAttrsRecursiveCond)

Noogle also knows

Aliases