1 { pkgs, lib, config, ... }:
3 inherit (config.users) users;
6 fileSystems."/var/lib/redis" = {
7 device = "rpool/var/redis";
13 unixSocket = "/run/redis/redis.socket";
16 bind = "127.0.0.1 ::1";
18 unixsocketperm = "660";
21 maxmemory-policy = "volatile-ttl";
25 users.users.redis.group = "redis";
26 users.groups."redis" = {};
28 systemd.services.redis.serviceConfig = {
29 RuntimeDirectoryMode = "0750";
30 Group = users.redis.group;
33 # As suggested by redis in its logs
34 boot.kernel.sysctl."vm.overcommit_memory" = 1;
35 system.activationScripts.redis = ''
36 echo never >/sys/kernel/mm/transparent_hugepage/enabled