diff options
author | Silvan Mosberger <contact@infinisil.com> | 2024-02-29 01:20:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-29 01:20:37 +0100 |
commit | 8e6598a68cb48af595ee1b1d057e6bc5ea5f2a9b (patch) | |
tree | 8ec6e24eb3512fef21798d07b68a1eff35d516a7 /nixos/doc/manual | |
parent | 518fb6209492468f20b282b5e986549aadf80ef9 (diff) | |
parent | 8b2d86b982c5d5c6f4c7402546d32b17eb6b07f8 (diff) | |
download | nixlib-8e6598a68cb48af595ee1b1d057e6bc5ea5f2a9b.tar nixlib-8e6598a68cb48af595ee1b1d057e6bc5ea5f2a9b.tar.gz nixlib-8e6598a68cb48af595ee1b1d057e6bc5ea5f2a9b.tar.bz2 nixlib-8e6598a68cb48af595ee1b1d057e6bc5ea5f2a9b.tar.lz nixlib-8e6598a68cb48af595ee1b1d057e6bc5ea5f2a9b.tar.xz nixlib-8e6598a68cb48af595ee1b1d057e6bc5ea5f2a9b.tar.zst nixlib-8e6598a68cb48af595ee1b1d057e6bc5ea5f2a9b.zip |
Merge pull request #286399 from benaryorg/global_ini_alt2
pkgs.formats: pkgs.formats version of lib.generators.toINIWithGlobalSection
Diffstat (limited to 'nixos/doc/manual')
-rw-r--r-- | nixos/doc/manual/development/settings-options.section.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/nixos/doc/manual/development/settings-options.section.md b/nixos/doc/manual/development/settings-options.section.md index 3a4800742b04..71ec9bbc8892 100644 --- a/nixos/doc/manual/development/settings-options.section.md +++ b/nixos/doc/manual/development/settings-options.section.md @@ -73,6 +73,34 @@ have a predefined type and string generator already declared under It returns a set with INI-specific attributes `type` and `generate` as specified [below](#pkgs-formats-result). + The type of the input is an *attrset* of sections; key-value pairs where + the key is the section name and the value is the corresponding content + which is also an *attrset* of key-value pairs for the actual key-value + mappings of the INI format. + The values of the INI atoms are subject to the above parameters (e.g. lists + may be transformed into multiple key-value pairs depending on + `listToValue`). + +`pkgs.formats.iniWithGlobalSection` { *`listsAsDuplicateKeys`* ? false, *`listToValue`* ? null, \.\.\. } + +: A function taking an attribute set with values + + `listsAsDuplicateKeys` + + : A boolean for controlling whether list values can be used to + represent duplicate INI keys + + `listToValue` + + : A function for turning a list of values into a single value. + + It returns a set with INI-specific attributes `type` and `generate` + as specified [below](#pkgs-formats-result). + The type of the input is an *attrset* of the structure + `{ sections = {}; globalSection = {}; }` where *sections* are several + sections as with *pkgs.formats.ini* and *globalSection* being just a single + attrset of key-value pairs for a single section, the global section which + preceedes the section definitions. `pkgs.formats.toml` { } |