nixos/redis: simplify

figsoda d65639ce dfff1a2b

Changed files
+3 -7
nixos
modules
services
databases
+3 -7
nixos/modules/services/databases/redis.nix
···
'');
servers = mkOption {
-
type = with types; attrsOf (submodule ({config, name, ...}@args: {
options = {
enable = mkEnableOption (lib.mdDoc ''
Redis server.
···
};
config.settings = mkMerge [
{
-
port = config.port;
daemonize = false;
supervised = "systemd";
loglevel = config.logLevel;
-
logfile = config.logfile;
syslog-enabled = config.syslog;
-
databases = config.databases;
-
maxclients = config.maxclients;
save = if config.save == []
then ''""'' # Disable saving with `save = ""`
else map
···
config.save;
dbfilename = "dump.rdb";
dir = "/var/lib/${redisName name}";
-
appendOnly = config.appendOnly;
appendfsync = config.appendFsync;
slowlog-log-slower-than = config.slowLogLogSlowerThan;
slowlog-max-len = config.slowLogMaxLen;
}
-
(mkIf (config.bind != null) { bind = config.bind; })
(mkIf (config.unixSocket != null) {
unixsocket = config.unixSocket;
unixsocketperm = toString config.unixSocketPerm;
···
'');
servers = mkOption {
+
type = with types; attrsOf (submodule ({ config, name, ... }: {
options = {
enable = mkEnableOption (lib.mdDoc ''
Redis server.
···
};
config.settings = mkMerge [
{
+
inherit (config) port logfile databases maxclients appendOnly;
daemonize = false;
supervised = "systemd";
loglevel = config.logLevel;
syslog-enabled = config.syslog;
save = if config.save == []
then ''""'' # Disable saving with `save = ""`
else map
···
config.save;
dbfilename = "dump.rdb";
dir = "/var/lib/${redisName name}";
appendfsync = config.appendFsync;
slowlog-log-slower-than = config.slowLogLogSlowerThan;
slowlog-max-len = config.slowLogMaxLen;
}
+
(mkIf (config.bind != null) { inherit (config) bind; })
(mkIf (config.unixSocket != null) {
unixsocket = config.unixSocket;
unixsocketperm = toString config.unixSocketPerm;