mirror of
https://github.com/nix-community/home-manager
synced 2024-11-22 20:53:14 +00:00
systemd: add support for socket units
This commit is contained in:
parent
8af6838869
commit
acf813cadc
1 changed files with 15 additions and 2 deletions
|
@ -7,7 +7,10 @@ let
|
|||
|
||||
cfg = config.systemd.user;
|
||||
|
||||
enabled = cfg.services != {} || cfg.targets != {} || cfg.timers != {};
|
||||
enabled = cfg.services != {}
|
||||
|| cfg.sockets != {}
|
||||
|| cfg.targets != {}
|
||||
|| cfg.timers != {};
|
||||
|
||||
toSystemdIni = (import lib/generators.nix).toINI {
|
||||
mkKeyValue = key: value:
|
||||
|
@ -50,6 +53,12 @@ in
|
|||
description = "Definition of systemd per-user service units.";
|
||||
};
|
||||
|
||||
sockets = mkOption {
|
||||
default = {};
|
||||
type = types.attrs;
|
||||
description = "Definition of systemd per-user sockets";
|
||||
};
|
||||
|
||||
targets = mkOption {
|
||||
default = {};
|
||||
type = types.attrs;
|
||||
|
@ -72,7 +81,9 @@ in
|
|||
message =
|
||||
let
|
||||
names = concatStringsSep ", " (
|
||||
attrNames (cfg.services // cfg.targets // cfg.timers)
|
||||
attrNames (
|
||||
cfg.services // cfg.sockets // cfg.targets // cfg.timers
|
||||
)
|
||||
);
|
||||
in
|
||||
"Must use Linux for modules that require systemd: " + names;
|
||||
|
@ -87,6 +98,8 @@ in
|
|||
listToAttrs (
|
||||
(buildServices "service" cfg.services)
|
||||
++
|
||||
(buildServices "socket" cfg.sockets)
|
||||
++
|
||||
(buildServices "target" cfg.targets)
|
||||
++
|
||||
(buildServices "timer" cfg.timers)
|
||||
|
|
Loading…
Reference in a new issue