Merge pull request #1137 from offlinehacker/nixos/redis/fix_user_syslog
nixos/redis: user set uid, log to syslog by default
This commit is contained in:
commit
f58a1f5c98
|
@ -102,6 +102,7 @@
|
||||||
tcpcryptd = 93; # tcpcryptd uses a hard-coded uid. We patch it in Nixpkgs to match this choice.
|
tcpcryptd = 93; # tcpcryptd uses a hard-coded uid. We patch it in Nixpkgs to match this choice.
|
||||||
zope2 = 94;
|
zope2 = 94;
|
||||||
firebird = 95;
|
firebird = 95;
|
||||||
|
redis = 96;
|
||||||
|
|
||||||
# When adding a uid, make sure it doesn't match an existing gid.
|
# When adding a uid, make sure it doesn't match an existing gid.
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ let
|
||||||
${condOption "unixsocket" cfg.unixSocket}
|
${condOption "unixsocket" cfg.unixSocket}
|
||||||
loglevel ${cfg.logLevel}
|
loglevel ${cfg.logLevel}
|
||||||
logfile ${cfg.logfile}
|
logfile ${cfg.logfile}
|
||||||
|
syslog-enabled ${redisBool cfg.syslog}
|
||||||
databases ${toString cfg.databases}
|
databases ${toString cfg.databases}
|
||||||
${concatMapStrings (d: "save ${toString (builtins.elemAt d 0)} ${toString (builtins.elemAt d 1)}\n") cfg.save}
|
${concatMapStrings (d: "save ${toString (builtins.elemAt d 0)} ${toString (builtins.elemAt d 1)}\n") cfg.save}
|
||||||
dbfilename ${cfg.dbFilename}
|
dbfilename ${cfg.dbFilename}
|
||||||
|
@ -82,12 +83,18 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
logfile = mkOption {
|
logfile = mkOption {
|
||||||
default = "stdout";
|
default = "/dev/null";
|
||||||
description = "Specify the log file name. Also 'stdout' can be used to force Redis to log on the standard output.";
|
description = "Specify the log file name. Also 'stdout' can be used to force Redis to log on the standard output.";
|
||||||
example = "/var/log/redis.log";
|
example = "/var/log/redis.log";
|
||||||
type = with types; string;
|
type = with types; string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
syslog = mkOption {
|
||||||
|
default = true;
|
||||||
|
description = "Enable logging to the system logger.";
|
||||||
|
type = with types; bool;
|
||||||
|
};
|
||||||
|
|
||||||
databases = mkOption {
|
databases = mkOption {
|
||||||
default = 16;
|
default = 16;
|
||||||
description = "Set the number of databases.";
|
description = "Set the number of databases.";
|
||||||
|
@ -177,8 +184,9 @@ in
|
||||||
|
|
||||||
config = mkIf config.services.redis.enable {
|
config = mkIf config.services.redis.enable {
|
||||||
|
|
||||||
users.extraUsers = singleton
|
users.extraUsers.redis =
|
||||||
{ name = cfg.user;
|
{ name = cfg.user;
|
||||||
|
uid = config.ids.uids.redis;
|
||||||
description = "Redis database user";
|
description = "Redis database user";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue