Merge pull request #244819 from ncfavier/toKeyValue-indent
lib/generators/toKeyValue: add `indent` parameter
This commit is contained in:
commit
b97ac82725
1 changed files with 3 additions and 2 deletions
|
@ -81,9 +81,10 @@ rec {
|
|||
*/
|
||||
toKeyValue = {
|
||||
mkKeyValue ? mkKeyValueDefault {} "=",
|
||||
listsAsDuplicateKeys ? false
|
||||
listsAsDuplicateKeys ? false,
|
||||
indent ? ""
|
||||
}:
|
||||
let mkLine = k: v: mkKeyValue k v + "\n";
|
||||
let mkLine = k: v: indent + mkKeyValue k v + "\n";
|
||||
mkLines = if listsAsDuplicateKeys
|
||||
then k: v: map (mkLine k) (if lib.isList v then v else [v])
|
||||
else k: v: [ (mkLine k v) ];
|
||||
|
|
Loading…
Reference in a new issue