3 Group configuration

Groups are defined in the file ${XDG_CONFIG_HOME}/tomloader/groups.kdl formatted as a KDL configuration file. Each group is declared by using a def-group node:


def-group Group1 {
    sd {
        (section)Unit {
            (add) After "dbus.service" "pipewire.service"
            (add) Requisite "dbus.service" "pipewire.service"
            (reset) JoinsNamespaceOf
            (set) Description "Group1"
        }
    }
}
def-group Group2 {
    sd {
        (section) Unit {
            (set) Documentation "man:group(2)"
        }
        (section) Service {
            (set) Type "exec"
        }
    }
}

Any valid KDL string can be used as group name, in particular you can embed whitespaces if you surround the whole name of the group between double quotes ‘"’.

Each group may contain zero or more sd nodes containing rules for Systemd fields. Each sd node contains nodes with type section (enclosed in parenthesis) representing systemd sections (e.g. Unit, Service, Slice). Within each section, the following operations are supported as node types:

set

assigns one or more values to a field;

reset

clears the field;

add

adds one or more values to the field.

The names of the nodes with type section, set, reset, add is the section/field name represented by such node.

Field values are internally represented as a list of strings. Just before generating the systemd unit file each list of strings is merged into a single:

Note: The order of values specified in set and add is not preserved, therefore in the generated unit they may appear in a different order (which will still be deterministic). If the order of those elements must be preserved, then a single set operation with a single string containing the ordered values is sufficient (Tomloader never adds double quotes ‘"’ to string values unless they are already present inside the value).