aboutsummaryrefslogtreecommitdiff
path: root/modules/private/databases
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-09-07 08:39:35 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-09-07 08:39:35 +0200
commit850adcf4b17afb6f5429b030f3c814d502d2b53e (patch)
tree9e30459cec309e4b04bed476f9444a9335dac0af /modules/private/databases
parentde6d17ec97a1946f628372e5b0854cb21a91a55f (diff)
downloadNix-850adcf4b17afb6f5429b030f3c814d502d2b53e.tar.gz
Nix-850adcf4b17afb6f5429b030f3c814d502d2b53e.tar.zst
Nix-850adcf4b17afb6f5429b030f3c814d502d2b53e.zip
Put services in slices in systemd
Diffstat (limited to 'modules/private/databases')
-rw-r--r--modules/private/databases/redis.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/private/databases/redis.nix b/modules/private/databases/redis.nix
index 4602510..bc6460f 100644
--- a/modules/private/databases/redis.nix
+++ b/modules/private/databases/redis.nix
@@ -41,6 +41,7 @@ in {
41 maxclients 1024 41 maxclients 1024
42 ''; 42 '';
43 }; 43 };
44 systemd.services.redis.serviceConfig.Slice = "redis.slice";
44 45
45 services.spiped = { 46 services.spiped = {
46 enable = true; 47 enable = true;
@@ -57,8 +58,9 @@ in {
57 wantedBy = [ "multi-user.target" ]; 58 wantedBy = [ "multi-user.target" ];
58 59
59 serviceConfig = { 60 serviceConfig = {
60 Restart = "always"; 61 Slice = "redis.slice";
61 User = "spiped"; 62 Restart = "always";
63 User = "spiped";
62 PermissionsStartOnly = true; 64 PermissionsStartOnly = true;
63 SupplementaryGroups = "keys"; 65 SupplementaryGroups = "keys";
64 }; 66 };
@@ -108,12 +110,17 @@ in {
108 } 110 }
109 ]; 111 ];
110 112
113 systemd.slices.redis = {
114 description = "Redis slice";
115 };
116
111 systemd.services.predixy = { 117 systemd.services.predixy = {
112 description = "Redis proxy"; 118 description = "Redis proxy";
113 wantedBy = [ "multi-user.target" ]; 119 wantedBy = [ "multi-user.target" ];
114 after = [ "redis.service" ]; 120 after = [ "redis.service" ];
115 121
116 serviceConfig = { 122 serviceConfig = {
123 Slice = "redis.slice";
117 User = "redis"; 124 User = "redis";
118 Group = "redis"; 125 Group = "redis";
119 SupplementaryGroups = "keys"; 126 SupplementaryGroups = "keys";