mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01: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;
|
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 {
|
toSystemdIni = (import lib/generators.nix).toINI {
|
||||||
mkKeyValue = key: value:
|
mkKeyValue = key: value:
|
||||||
|
@ -50,6 +53,12 @@ in
|
||||||
description = "Definition of systemd per-user service units.";
|
description = "Definition of systemd per-user service units.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sockets = mkOption {
|
||||||
|
default = {};
|
||||||
|
type = types.attrs;
|
||||||
|
description = "Definition of systemd per-user sockets";
|
||||||
|
};
|
||||||
|
|
||||||
targets = mkOption {
|
targets = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
|
@ -72,7 +81,9 @@ in
|
||||||
message =
|
message =
|
||||||
let
|
let
|
||||||
names = concatStringsSep ", " (
|
names = concatStringsSep ", " (
|
||||||
attrNames (cfg.services // cfg.targets // cfg.timers)
|
attrNames (
|
||||||
|
cfg.services // cfg.sockets // cfg.targets // cfg.timers
|
||||||
|
)
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
"Must use Linux for modules that require systemd: " + names;
|
"Must use Linux for modules that require systemd: " + names;
|
||||||
|
@ -87,6 +98,8 @@ in
|
||||||
listToAttrs (
|
listToAttrs (
|
||||||
(buildServices "service" cfg.services)
|
(buildServices "service" cfg.services)
|
||||||
++
|
++
|
||||||
|
(buildServices "socket" cfg.sockets)
|
||||||
|
++
|
||||||
(buildServices "target" cfg.targets)
|
(buildServices "target" cfg.targets)
|
||||||
++
|
++
|
||||||
(buildServices "timer" cfg.timers)
|
(buildServices "timer" cfg.timers)
|
||||||
|
|
Loading…
Reference in a new issue