Add support for systemd path units
This commit is contained in:
parent
97ee4578c9
commit
299e01722f
|
@ -11,7 +11,8 @@ let
|
||||||
enabled = cfg.services != {}
|
enabled = cfg.services != {}
|
||||||
|| cfg.sockets != {}
|
|| cfg.sockets != {}
|
||||||
|| cfg.targets != {}
|
|| cfg.targets != {}
|
||||||
|| cfg.timers != {};
|
|| cfg.timers != {}
|
||||||
|
|| cfg.paths != {};
|
||||||
|
|
||||||
toSystemdIni = generators.toINI {
|
toSystemdIni = generators.toINI {
|
||||||
mkKeyValue = key: value:
|
mkKeyValue = key: value:
|
||||||
|
@ -108,6 +109,15 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
paths = mkOption {
|
||||||
|
default = {};
|
||||||
|
type = attrsRecursivelyMerged;
|
||||||
|
description = ''
|
||||||
|
Definition of systemd per-user path units. Attributes are
|
||||||
|
merged recursively.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
startServices = mkOption {
|
startServices = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
|
@ -138,7 +148,7 @@ in
|
||||||
let
|
let
|
||||||
names = concatStringsSep ", " (
|
names = concatStringsSep ", " (
|
||||||
attrNames (
|
attrNames (
|
||||||
cfg.services // cfg.sockets // cfg.targets // cfg.timers
|
cfg.services // cfg.sockets // cfg.targets // cfg.timers // cfg.paths
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
|
@ -159,6 +169,8 @@ in
|
||||||
(buildServices "target" cfg.targets)
|
(buildServices "target" cfg.targets)
|
||||||
++
|
++
|
||||||
(buildServices "timer" cfg.timers)
|
(buildServices "timer" cfg.timers)
|
||||||
|
++
|
||||||
|
(buildServices "path" cfg.paths)
|
||||||
);
|
);
|
||||||
|
|
||||||
# Run systemd service reload if user is logged in. If we're
|
# Run systemd service reload if user is logged in. If we're
|
||||||
|
|
Loading…
Reference in a new issue