From 850adcf4b17afb6f5429b030f3c814d502d2b53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 7 Sep 2020 08:39:35 +0200 Subject: Put services in slices in systemd --- modules/private/buildbot/default.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/private/buildbot/default.nix') diff --git a/modules/private/buildbot/default.nix b/modules/private/buildbot/default.nix index 3dc6a04..6674ad7 100644 --- a/modules/private/buildbot/default.nix +++ b/modules/private/buildbot/default.nix @@ -126,6 +126,10 @@ in ] ++ lib.attrsets.mapAttrsToList (k: v: "/var/secrets/buildbot/${project.name}/${k}") project.secrets; }) config.myEnv.buildbot.projects; + systemd.slices.buildbot = { + description = "buildbot slice"; + }; + systemd.services = lib.attrsets.mapAttrs' (k: project: lib.attrsets.nameValuePair "buildbot-${project.name}" { description = "Buildbot Continuous Integration Server ${project.name}."; after = [ "network-online.target" ]; @@ -207,6 +211,7 @@ in in project_env // { inherit PYTHONPATH HOME; }; serviceConfig = { + Slice = "buildbot.slice"; Type = "forking"; User = "buildbot"; Group = "buildbot"; -- cgit v1.2.3