lib: attrs: add 'recursiveMerge'
This commit is contained in:
parent
c13e57f584
commit
8ce123c527
|
@ -1,6 +1,13 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib) filterAttrs listToAttrs mapAttrs' nameValuePair;
|
||||
inherit (lib)
|
||||
filterAttrs
|
||||
foldl
|
||||
listToAttrs
|
||||
mapAttrs'
|
||||
nameValuePair
|
||||
recursiveUpdate
|
||||
;
|
||||
in
|
||||
{
|
||||
# Filter a generated set of attrs using a predicate function.
|
||||
|
@ -19,6 +26,13 @@ in
|
|||
# attrs
|
||||
genAttrs' = values: f: listToAttrs (map f values);
|
||||
|
||||
# Merge a list of attrs recursively, later values override previous ones.
|
||||
#
|
||||
# recursiveMerge ::
|
||||
# [ attrs ]
|
||||
# attrs
|
||||
recursiveMerge = foldl recursiveUpdate { };
|
||||
|
||||
# Rename each of the attributes in an attribute set using the mapping function
|
||||
#
|
||||
# renameAttrs ::
|
||||
|
|
Loading…
Reference in a new issue