{ pkgs, lib, config, ... }: let inherit (config.users) users; in { services.redis = { enable = true; unixSocket = "/run/redis/redis.socket"; databases = 16; syslog = true; extraConfig = '' bind 127.0.0.1 ::1 unixsocketperm 660 maxclients 1024 maxmemory 500mb maxmemory-policy volatile-ttl ''; }; users.users.redis.group = "redis"; users.groups."redis" = {}; systemd.services.redis.serviceConfig = { RuntimeDirectoryMode = "0750"; Group = users.redis.group; }; }