lib: add concatMap
This commit is contained in:
parent
188ace87db
commit
b82eb761c4
1 changed files with 7 additions and 6 deletions
13
lib.nix
13
lib.nix
|
@ -13,6 +13,12 @@ rec {
|
||||||
in
|
in
|
||||||
fold' 0;
|
fold' 0;
|
||||||
|
|
||||||
|
concatMap = op: list:
|
||||||
|
let
|
||||||
|
concat = (a: b: op a + b);
|
||||||
|
in
|
||||||
|
foldr concat "" list;
|
||||||
|
|
||||||
extractAttrs = attr: list:
|
extractAttrs = attr: list:
|
||||||
let
|
let
|
||||||
getAttr' = builtins.getAttr attr;
|
getAttr' = builtins.getAttr attr;
|
||||||
|
@ -30,10 +36,5 @@ rec {
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
|
|
||||||
mkLuaRc = contents:
|
mkLuaRc = contents: concatMap mkLuaHeredoc contents;
|
||||||
let
|
|
||||||
concat = (a: b: a + b);
|
|
||||||
luaHeredors = builtins.map mkLuaHeredoc contents;
|
|
||||||
in
|
|
||||||
foldr concat "" luaHeredors;
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue