summary refs log tree commit diff
path: root/nixos/modules/services/databases/redis.nix
diff options
context:
space:
mode:
authorIzorkin <izorkin@elven.pw>2021-03-24 13:13:47 +0300
committerIzorkin <izorkin@elven.pw>2021-04-03 19:07:27 +0300
commit86d8b31e00b267f0ed67798e966c16ef06faf9ba (patch)
tree7ebc1471d1722f0a4be10f5c88a5c405aef1f1ac /nixos/modules/services/databases/redis.nix
parent94fa194b9fb77ab953805e83ba80b5837499b96f (diff)
downloadnixpkgs-86d8b31e00b267f0ed67798e966c16ef06faf9ba.tar
nixpkgs-86d8b31e00b267f0ed67798e966c16ef06faf9ba.tar.gz
nixpkgs-86d8b31e00b267f0ed67798e966c16ef06faf9ba.tar.bz2
nixpkgs-86d8b31e00b267f0ed67798e966c16ef06faf9ba.tar.lz
nixpkgs-86d8b31e00b267f0ed67798e966c16ef06faf9ba.tar.xz
nixpkgs-86d8b31e00b267f0ed67798e966c16ef06faf9ba.tar.zst
nixpkgs-86d8b31e00b267f0ed67798e966c16ef06faf9ba.zip
nixos/redis: add option unixSocketPerm
Diffstat (limited to 'nixos/modules/services/databases/redis.nix')
-rw-r--r--nixos/modules/services/databases/redis.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/nixos/modules/services/databases/redis.nix b/nixos/modules/services/databases/redis.nix
index 117e6366225..b5921a6dead 100644
--- a/nixos/modules/services/databases/redis.nix
+++ b/nixos/modules/services/databases/redis.nix
@@ -88,6 +88,13 @@ in
         example = "/run/redis/redis.sock";
       };
 
+      unixSocketPerm = mkOption {
+        type = types.int;
+        default = 750;
+        description = "Change permissions for the socket";
+        example = 700;
+      };
+
       logLevel = mkOption {
         type = types.str;
         default = "notice"; # debug, verbose, notice, warning
@@ -204,7 +211,6 @@ in
         '';
         example = literalExample ''
           {
-            unixsocketperm = "700";
             loadmodule = [ "/path/to/my_module.so" "/path/to/other_module.so" ];
           }
         '';
@@ -256,7 +262,7 @@ in
         slowlog-max-len = cfg.slowLogMaxLen;
       }
       (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.masterAuth != null) { masterauth = cfg.masterAuth; })
       (mkIf (cfg.requirePass != null) { requirepass = cfg.requirePass; })