From ce54db6fe127c5199e088273fa0b275ef7f1cb44 Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 29 Jun 2023 18:36:25 +0300 Subject: [PATCH] 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 = { }; }; ```` --- lib/generators.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)