nixos/redis: add option unixSocketPerm
This commit is contained in:
parent
94fa194b9f
commit
86d8b31e00
|
@ -88,6 +88,13 @@ in
|
||||||
example = "/run/redis/redis.sock";
|
example = "/run/redis/redis.sock";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
unixSocketPerm = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 750;
|
||||||
|
description = "Change permissions for the socket";
|
||||||
|
example = 700;
|
||||||
|
};
|
||||||
|
|
||||||
logLevel = mkOption {
|
logLevel = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "notice"; # debug, verbose, notice, warning
|
default = "notice"; # debug, verbose, notice, warning
|
||||||
|
@ -204,7 +211,6 @@ in
|
||||||
'';
|
'';
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
{
|
{
|
||||||
unixsocketperm = "700";
|
|
||||||
loadmodule = [ "/path/to/my_module.so" "/path/to/other_module.so" ];
|
loadmodule = [ "/path/to/my_module.so" "/path/to/other_module.so" ];
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
@ -256,7 +262,7 @@ in
|
||||||
slowlog-max-len = cfg.slowLogMaxLen;
|
slowlog-max-len = cfg.slowLogMaxLen;
|
||||||
}
|
}
|
||||||
(mkIf (cfg.bind != null) { bind = cfg.bind; })
|
(mkIf (cfg.bind != null) { bind = cfg.bind; })
|
||||||
(mkIf (cfg.unixSocket != null) { unixsocket = cfg.unixSocket; })
|
(mkIf (cfg.unixSocket != null) { unixsocket = cfg.unixSocket; unixsocketperm = "${toString cfg.unixSocketPerm}"; })
|
||||||
(mkIf (cfg.slaveOf != null) { slaveof = "${cfg.slaveOf.ip} ${cfg.slaveOf.port}"; })
|
(mkIf (cfg.slaveOf != null) { slaveof = "${cfg.slaveOf.ip} ${cfg.slaveOf.port}"; })
|
||||||
(mkIf (cfg.masterAuth != null) { masterauth = cfg.masterAuth; })
|
(mkIf (cfg.masterAuth != null) { masterauth = cfg.masterAuth; })
|
||||||
(mkIf (cfg.requirePass != null) { requirepass = cfg.requirePass; })
|
(mkIf (cfg.requirePass != null) { requirepass = cfg.requirePass; })
|
||||||
|
|
|
@ -17,7 +17,7 @@ in
|
||||||
services.redis.unixSocket = redisSocket;
|
services.redis.unixSocket = redisSocket;
|
||||||
|
|
||||||
# Allow access to the unix socket for the "redis" group.
|
# Allow access to the unix socket for the "redis" group.
|
||||||
services.redis.settings.unixsocketperm = "770";
|
services.redis.unixSocketPerm = 770;
|
||||||
|
|
||||||
users.users."member" = {
|
users.users."member" = {
|
||||||
createHome = false;
|
createHome = false;
|
||||||
|
|
Loading…
Reference in New Issue