'';
};
# Output variables
- systemdRuntimeDirectory = lib.mkOption {
- type = lib.types.str;
- # Use ReadWritePaths= instead if socketsDir is outside of /run
- default = assert lib.strings.hasPrefix "/run/" cfg.socketsDir;
- lib.strings.removePrefix "/run/" cfg.socketsDir;
- description = ''
- Adjusted redis sockets directory for systemd
- '';
- readOnly = true;
- };
sockets = lib.mkOption {
type = lib.types.attrsOf lib.types.path;
default = {
maxclients 1024
'';
};
- systemd.services.redis.serviceConfig.RuntimeDirectory = cfg.systemdRuntimeDirectory;
+ systemd.services.redis.serviceConfig.Slice = "redis.slice";
services.spiped = {
enable = true;
wantedBy = [ "multi-user.target" ];
serviceConfig = {
- Restart = "always";
- User = "spiped";
+ Slice = "redis.slice";
+ Restart = "always";
+ User = "spiped";
PermissionsStartOnly = true;
SupplementaryGroups = "keys";
};
}
];
+ systemd.slices.redis = {
+ description = "Redis slice";
+ };
+
systemd.services.predixy = {
description = "Redis proxy";
wantedBy = [ "multi-user.target" ];
after = [ "redis.service" ];
serviceConfig = {
+ Slice = "redis.slice";
User = "redis";
Group = "redis";
SupplementaryGroups = "keys";