From 275d1b52126674764f0f3d15c73c2add511bd310 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 4 Dec 2020 14:14:24 +0100 Subject: [PATCH] systemd: allow creating slices --- modules/systemd.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/systemd.nix b/modules/systemd.nix index 10f0f6a8a..755aac25c 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -7,6 +7,7 @@ let cfg = config.systemd.user; enabled = cfg.services != {} + || cfg.slices != {} || cfg.sockets != {} || cfg.targets != {} || cfg.timers != {} @@ -125,6 +126,13 @@ in example = unitExample "Service"; }; + slices = mkOption { + default = {}; + type = unitType "slices"; + description = unitDescription "slices"; + example = unitExample "Slices"; + }; + sockets = mkOption { default = {}; type = unitType "socket"; @@ -197,7 +205,8 @@ in let names = concatStringsSep ", " ( 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 @@ -213,6 +222,8 @@ in (listToAttrs ( (buildServices "service" cfg.services) ++ + (buildServices "slices" cfg.slices) + ++ (buildServices "socket" cfg.sockets) ++ (buildServices "target" cfg.targets)