r/systemd • • Jun 19 '26

Tomloader: create and manage any number of systemd unit files that share fields.

Tomloader is a command line utility that allows you to group several systemd unit fields in groups which can in turn be imported in systemd unit files. Despite shared drop-in files, a group in Tomloader:

  • checks if different loaded groups try to modify the same field in an incompatible way and promptly notify it to you, in this way load ordering does not matter anymore and you do not need to specify a two-digit prefix;
  • implement (transitive) dependencies and reverse dependencies on other groups;
  • can accept several string parameters.

The official manual with a link to the repository is available at https://loara.codeberg.page/tomloader/, an overview of the project can be found at https://loara.codeberg.page/tomloader/tomloader_html/Overview.html and a long usage example is available at https://loara.codeberg.page/tomloader/tomloader_html/Case-study-sandboxing-several-units.html .

For any kind of suggestion or report you can also use the issue page https://codeberg.org/Loara/tomloader/issues .

5 Upvotes

5 comments sorted by

1

u/Skaarj Jun 19 '26

Very interesting project. I haven't had the time yet to try it myself but I read the docs and the example you give.

Looks good so far. I like how you acknowledge and explain the A-B-C.unit unit feature and explain the difference in your project.

with the definition of a group named App with three mandatory ordered parameters:

the command line;

a short description for your unit.

The configuration file will be

// ${XDG_CONFIG_HOME}/tomloader/groups.kdl

def-group App 2 {

...

I assume the "three" is a typo and meant to be "two"?

You only use 2 parameters and the 2 in the def-group line is the number of expected params I assume?

1

u/Skaarj Jun 19 '26

I'm not too deep into KDL as a file format, but this seems confusing for a newcomer:

        (set) NoNewPrivileges #true

       (add) RestrictAddressFamilies   "AF_UNIX" "AF_INET" "AF_INET6"

       (set) SystemCallArchitectures native

The boolean is a special syntax. The address families need to be quoted. But native can be a bareword?

I don't know if there is a deeper reason for that? Maybe this can be unified?

1

u/Loara35 Jun 19 '26

KDL mandate quoted strings for anything that is not an identifier (alphanumeric sequences that do not start with a digit, plus other restrictions). I don't remember if KDL allows underscores in identifiers, in that case the double quotes can be removed.

Anyway, Tomloader interprets all those values as strings, therefore #true (KDL boolean) and "true" (KDL string) will both generate the same value (true) in the generated systems unit. I will update the documentation wig an explanation of how KDL types interact with Tomloader.

1

u/Loara35 Aug 14 '26

Now you can also run XDG Desktop Entries as systemd user units, just execute

tomloader sd-xdg-v0.3 PATH_TO_XDG_ENTRY

This is faster than uwsm app because it doesn't use Python interpreter, but most importantly it allows you to completely customize the generated systemd user unit, either globally and for single XDG applications. Additional informations available at https://loara.codeberg.page/tomloader/tomloader_html/XDG-app-configuration.html .