1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-29 01:48:31 +02:00

systemd: allow creating slices

This commit is contained in:
Sandro Jäckel 2020-12-04 14:14:24 +01:00 committed by Robert Helgesson
parent aaa5329d39
commit 275d1b5212
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89

View File

@ -7,6 +7,7 @@ let
cfg = config.systemd.user; cfg = config.systemd.user;
enabled = cfg.services != {} enabled = cfg.services != {}
|| cfg.slices != {}
|| cfg.sockets != {} || cfg.sockets != {}
|| cfg.targets != {} || cfg.targets != {}
|| cfg.timers != {} || cfg.timers != {}
@ -125,6 +126,13 @@ in
example = unitExample "Service"; example = unitExample "Service";
}; };
slices = mkOption {
default = {};
type = unitType "slices";
description = unitDescription "slices";
example = unitExample "Slices";
};
sockets = mkOption { sockets = mkOption {
default = {}; default = {};
type = unitType "socket"; type = unitType "socket";
@ -197,7 +205,8 @@ in
let let
names = concatStringsSep ", " ( names = concatStringsSep ", " (
attrNames ( attrNames (
cfg.services // cfg.sockets // cfg.targets // cfg.timers // cfg.paths // cfg.sessionVariables cfg.services // cfg.slices // cfg.sockets // cfg.targets
// cfg.timers // cfg.paths // cfg.sessionVariables
) )
); );
in in
@ -213,6 +222,8 @@ in
(listToAttrs ( (listToAttrs (
(buildServices "service" cfg.services) (buildServices "service" cfg.services)
++ ++
(buildServices "slices" cfg.slices)
++
(buildServices "socket" cfg.sockets) (buildServices "socket" cfg.sockets)
++ ++
(buildServices "target" cfg.targets) (buildServices "target" cfg.targets)