formats.systemd: init INI-style systemd config file format

This commit is contained in:
Minijackson 2022-09-01 14:43:59 +02:00 committed by Raito Bezarius
parent f9a1ba6987
commit ad586e6beb

View File

@ -142,6 +142,20 @@ rec {
};
# As defined by systemd.syntax(7)
#
# null does not set any value, which allows for RFC42 modules to specify
# optional config options.
systemd = let
mkValueString = lib.generators.mkValueStringDefault {};
mkKeyValue = k: v:
if v == null then "# ${k} is unset"
else "${k} = ${mkValueString v}";
in ini {
listsAsDuplicateKeys = true;
inherit mkKeyValue;
};
keyValue = {
# Represents lists as duplicate keys
listsAsDuplicateKeys ? false,