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 = lib.mkForce "660";
20 maxmemory-policy = "volatile-ttl";
24 users.users.redis.group = "redis";
25 users.groups."redis" = {};
27 systemd.services.redis.serviceConfig = {
28 RuntimeDirectoryMode = "0750";
29 Group = users.redis.group;
32 # As suggested by redis in its logs
33 boot.kernel.sysctl."vm.overcommit_memory" = 1;
34 system.activationScripts.redis = ''
35 echo never >/sys/kernel/mm/transparent_hugepage/enabled
38 services.sanoid.datasets."rpool/var/redis" = {
39 use_template = [ "local" ];