nixos: add enabled dataspace servers to systemd wants

This commit is contained in:
Emery Hemingway 2022-06-24 09:11:21 -05:00
parent cc09df4d35
commit d7aadda36f
1 changed files with 6 additions and 1 deletions

View File

@ -14,7 +14,7 @@ with lib;
description = ''
Syndicate dataspace server instances.
If the key is in the form of "tty''${N}" it will
be attached to the appropriate teletypwriter.
be attached to the appropriate teletypewriter.
'';
type = types.attrsOf (types.submodule {
options = {
@ -92,6 +92,11 @@ with lib;
})
(lib.attrsets.filterAttrs (_: cfg: cfg.enable) config.services.syndicate);
systemd.targets.multi-user.wants = lib.lists.flatten
(lib.attrsets.mapAttrsToList
(name: cfg: lib.optional cfg.enable "syndicate-${name}.service")
config.services.syndicate);
};
}