diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-09-07 08:39:35 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2020-09-07 08:39:35 +0200 |
commit | 850adcf4b17afb6f5429b030f3c814d502d2b53e (patch) | |
tree | 9e30459cec309e4b04bed476f9444a9335dac0af /modules/private/tasks | |
parent | de6d17ec97a1946f628372e5b0854cb21a91a55f (diff) | |
download | Nix-850adcf4b17afb6f5429b030f3c814d502d2b53e.tar.gz Nix-850adcf4b17afb6f5429b030f3c814d502d2b53e.tar.zst Nix-850adcf4b17afb6f5429b030f3c814d502d2b53e.zip |
Put services in slices in systemd
Diffstat (limited to 'modules/private/tasks')
-rw-r--r-- | modules/private/tasks/default.nix | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/private/tasks/default.nix b/modules/private/tasks/default.nix index 5e1ac1e..b523995 100644 --- a/modules/private/tasks/default.nix +++ b/modules/private/tasks/default.nix | |||
@@ -263,6 +263,10 @@ in { | |||
263 | ''; | 263 | ''; |
264 | }; | 264 | }; |
265 | 265 | ||
266 | systemd.slices.taskwarrior = { | ||
267 | description = "Taskwarrior slice"; | ||
268 | }; | ||
269 | |||
266 | systemd.services = (lib.attrsets.mapAttrs' (name: userConfig: | 270 | systemd.services = (lib.attrsets.mapAttrs' (name: userConfig: |
267 | let | 271 | let |
268 | credentials = "${userConfig.org}/${name}/${userConfig.key}"; | 272 | credentials = "${userConfig.org}/${name}/${userConfig.key}"; |
@@ -314,6 +318,7 @@ in { | |||
314 | ''; | 318 | ''; |
315 | 319 | ||
316 | serviceConfig = { | 320 | serviceConfig = { |
321 | Slice = "taskwarrior.slice"; | ||
317 | User = user; | 322 | User = user; |
318 | PrivateTmp = true; | 323 | PrivateTmp = true; |
319 | Restart = "always"; | 324 | Restart = "always"; |
@@ -334,6 +339,9 @@ in { | |||
334 | chown :${group} "${server_vardir}/keys/ca.key" | 339 | chown :${group} "${server_vardir}/keys/ca.key" |
335 | chmod g+r "${server_vardir}/keys/ca.key" | 340 | chmod g+r "${server_vardir}/keys/ca.key" |
336 | ''; | 341 | ''; |
342 | taskserver-ca.serviceConfig.Slice = "taskwarrior.slice"; | ||
343 | taskserver-init.serviceConfig.Slice = "taskwarrior.slice"; | ||
344 | taskserver.serviceConfig.Slice = "taskwarrior.slice"; | ||
337 | }; | 345 | }; |
338 | 346 | ||
339 | }; | 347 | }; |