Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/redis: fix port option #156004

Merged
merged 1 commit into from Jan 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions nixos/modules/services/databases/redis.nix
Expand Up @@ -87,8 +87,12 @@ in {

port = mkOption {
type = types.port;
default = 6379;
description = "The port for Redis to listen to.";
default = if name == "" then 6379 else 0;
defaultText = literalExpression ''if name == "" then 6379 else 0'';
description = ''
The TCP port to accept connections.
If port 0 is specified Redis will not listen on a TCP socket.
'';
};

openFirewall = mkOption {
Expand All @@ -102,7 +106,7 @@ in {
bind = mkOption {
type = with types; nullOr str;
default = if name == "" then "127.0.0.1" else null;
defaultText = "127.0.0.1 or null if name != \"\"";
defaultText = literalExpression ''if name == "" then "127.0.0.1" else null'';
description = ''
The IP interface to bind to.
<literal>null</literal> means "all interfaces".
Expand Down Expand Up @@ -253,7 +257,7 @@ in {
};
config.settings = mkMerge [
{
port = if config.bind == null then 0 else config.port;
port = config.port;
daemonize = false;
supervised = "systemd";
loglevel = config.logLevel;
Expand Down