Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/modules/misc/ids.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
tcpcryptd = 93; # tcpcryptd uses a hard-coded uid. We patch it in Nixpkgs to match this choice.
zope2 = 94;
firebird = 95;
redis = 96;

# When adding a uid, make sure it doesn't match an existing gid.

Expand Down
12 changes: 10 additions & 2 deletions nixos/modules/services/databases/redis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let
${condOption "unixsocket" cfg.unixSocket}
loglevel ${cfg.logLevel}
logfile ${cfg.logfile}
syslog-enabled ${redisBool cfg.syslog}
databases ${toString cfg.databases}
${concatMapStrings (d: "save ${toString (builtins.elemAt d 0)} ${toString (builtins.elemAt d 1)}\n") cfg.save}
dbfilename ${cfg.dbFilename}
Expand Down Expand Up @@ -82,12 +83,18 @@ in
};

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.";
example = "/var/log/redis.log";
type = with types; string;
};

syslog = mkOption {
default = true;
description = "Enable logging to the system logger.";
type = with types; bool;
};

databases = mkOption {
default = 16;
description = "Set the number of databases.";
Expand Down Expand Up @@ -177,8 +184,9 @@ in

config = mkIf config.services.redis.enable {

users.extraUsers = singleton
users.extraUsers.redis =
{ name = cfg.user;
uid = config.ids.uids.redis;
description = "Redis database user";
};

Expand Down