summaryrefslogtreecommitdiffstats
path: root/lib/generators.nix
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-06-29 18:36:25 +0300
committerArtturin <Artturin@artturin.com>2023-06-29 18:41:34 +0300
commitce54db6fe127c5199e088273fa0b275ef7f1cb44 (patch)
tree4d1391be197ef446922407fc78c3619777254718 /lib/generators.nix
parent7076a89db0770da2c8e0b57f7158eb90345f6c11 (diff)
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 = { }; }; ````
Diffstat (limited to 'lib/generators.nix')
-rw-r--r--lib/generators.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/generators.nix b/lib/generators.nix
index 496845fc9ae4..a2dddedd2d3a 100644
--- a/lib/generators.nix
+++ b/lib/generators.nix
@@ -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)