lib.generators.toINIWithGlobalSection: give sections a default

often sections aren't needed when using globalSection

currently one has to `sections = { }` when using only globalSection

```
lib.generators.toINIWithGlobalSection { } {
  globalSection = {
    background_color = "1d202199";
  };
  sections = { };
};
````
This commit is contained in:
Artturin 2023-06-29 18:36:25 +03:00
parent 7076a89db0
commit ce54db6fe1

@ -168,7 +168,7 @@ rec {
mkKeyValue ? mkKeyValueDefault {} "=",
# allow lists as values for duplicate keys
listsAsDuplicateKeys ? false
}: { globalSection, sections }:
}: { globalSection, sections ? {} }:
( if globalSection == {}
then ""
else (toKeyValue { inherit mkKeyValue listsAsDuplicateKeys; } globalSection)