mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-22 03:53:47 +00:00
nixos/redis: clean up option types
Some options lack a type and some use the deprecated "string" type. Fix it.
This commit is contained in:
parent
85e444f4f8
commit
89fee1006c
@ -38,86 +38,92 @@ in
|
|||||||
services.redis = {
|
services.redis = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Whether to enable the Redis server.";
|
description = "Whether to enable the Redis server.";
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
default = pkgs.redis;
|
default = pkgs.redis;
|
||||||
description = "Which Redis derivation to use.";
|
description = "Which Redis derivation to use.";
|
||||||
type = types.package;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
|
type = types.str;
|
||||||
default = "redis";
|
default = "redis";
|
||||||
description = "User account under which Redis runs.";
|
description = "User account under which Redis runs.";
|
||||||
};
|
};
|
||||||
|
|
||||||
pidFile = mkOption {
|
pidFile = mkOption {
|
||||||
|
type = types.path;
|
||||||
default = "/var/lib/redis/redis.pid";
|
default = "/var/lib/redis/redis.pid";
|
||||||
description = "";
|
description = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
|
type = types.int;
|
||||||
default = 6379;
|
default = 6379;
|
||||||
description = "The port for Redis to listen to.";
|
description = "The port for Redis to listen to.";
|
||||||
type = with types; int;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bind = mkOption {
|
bind = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
default = null; # All interfaces
|
default = null; # All interfaces
|
||||||
description = "The IP interface to bind to.";
|
description = "The IP interface to bind to.";
|
||||||
example = "127.0.0.1";
|
example = "127.0.0.1";
|
||||||
};
|
};
|
||||||
|
|
||||||
unixSocket = mkOption {
|
unixSocket = mkOption {
|
||||||
|
type = with types; nullOr path;
|
||||||
default = null;
|
default = null;
|
||||||
description = "The path to the socket to bind to.";
|
description = "The path to the socket to bind to.";
|
||||||
example = "/var/run/redis.sock";
|
example = "/var/run/redis.sock";
|
||||||
};
|
};
|
||||||
|
|
||||||
logLevel = mkOption {
|
logLevel = mkOption {
|
||||||
|
type = types.str;
|
||||||
default = "notice"; # debug, verbose, notice, warning
|
default = "notice"; # debug, verbose, notice, warning
|
||||||
example = "debug";
|
example = "debug";
|
||||||
description = "Specify the server verbosity level, options: debug, verbose, notice, warning.";
|
description = "Specify the server verbosity level, options: debug, verbose, notice, warning.";
|
||||||
type = with types; string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
logfile = mkOption {
|
logfile = mkOption {
|
||||||
|
type = types.str;
|
||||||
default = "/dev/null";
|
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;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
syslog = mkOption {
|
syslog = mkOption {
|
||||||
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
description = "Enable logging to the system logger.";
|
description = "Enable logging to the system logger.";
|
||||||
type = with types; bool;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
databases = mkOption {
|
databases = mkOption {
|
||||||
|
type = types.int;
|
||||||
default = 16;
|
default = 16;
|
||||||
description = "Set the number of databases.";
|
description = "Set the number of databases.";
|
||||||
type = with types; int;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
save = mkOption {
|
save = mkOption {
|
||||||
|
type = with types; listOf listOf int;
|
||||||
default = [ [900 1] [300 10] [60 10000] ];
|
default = [ [900 1] [300 10] [60 10000] ];
|
||||||
description = "The schedule in which data is persisted to disk, represented as a list of lists where the first element represent the amount of seconds and the second the number of changes.";
|
description = "The schedule in which data is persisted to disk, represented as a list of lists where the first element represent the amount of seconds and the second the number of changes.";
|
||||||
example = [ [900 1] [300 10] [60 10000] ];
|
example = [ [900 1] [300 10] [60 10000] ];
|
||||||
};
|
};
|
||||||
|
|
||||||
dbFilename = mkOption {
|
dbFilename = mkOption {
|
||||||
|
type = types.str;
|
||||||
default = "dump.rdb";
|
default = "dump.rdb";
|
||||||
description = "The filename where to dump the DB.";
|
description = "The filename where to dump the DB.";
|
||||||
type = with types; string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
dbpath = mkOption {
|
dbpath = mkOption {
|
||||||
|
type = types.path;
|
||||||
default = "/var/lib/redis";
|
default = "/var/lib/redis";
|
||||||
description = "The DB will be written inside this directory, with the filename specified using the 'dbFilename' configuration.";
|
description = "The DB will be written inside this directory, with the filename specified using the 'dbFilename' configuration.";
|
||||||
type = with types; string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
slaveOf = mkOption {
|
slaveOf = mkOption {
|
||||||
@ -135,46 +141,47 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
requirePass = mkOption {
|
requirePass = mkOption {
|
||||||
|
type = with types; nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
description = "Password for database (STORED PLAIN TEXT, WORLD-READABLE IN NIX STORE)";
|
description = "Password for database (STORED PLAIN TEXT, WORLD-READABLE IN NIX STORE)";
|
||||||
example = "letmein!";
|
example = "letmein!";
|
||||||
};
|
};
|
||||||
|
|
||||||
appendOnly = mkOption {
|
appendOnly = mkOption {
|
||||||
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "By default data is only periodically persisted to disk, enable this option to use an append-only file for improved persistence.";
|
description = "By default data is only periodically persisted to disk, enable this option to use an append-only file for improved persistence.";
|
||||||
type = with types; bool;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
appendOnlyFilename = mkOption {
|
appendOnlyFilename = mkOption {
|
||||||
|
type = types.str;
|
||||||
default = "appendonly.aof";
|
default = "appendonly.aof";
|
||||||
description = "Filename for the append-only file (stored inside of dbpath)";
|
description = "Filename for the append-only file (stored inside of dbpath)";
|
||||||
type = with types; string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
appendFsync = mkOption {
|
appendFsync = mkOption {
|
||||||
|
type = types.str;
|
||||||
default = "everysec"; # no, always, everysec
|
default = "everysec"; # no, always, everysec
|
||||||
description = "How often to fsync the append-only log, options: no, always, everysec.";
|
description = "How often to fsync the append-only log, options: no, always, everysec.";
|
||||||
type = with types; string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
slowLogLogSlowerThan = mkOption {
|
slowLogLogSlowerThan = mkOption {
|
||||||
|
type = types.int;
|
||||||
default = 10000;
|
default = 10000;
|
||||||
description = "Log queries whose execution take longer than X in milliseconds.";
|
description = "Log queries whose execution take longer than X in milliseconds.";
|
||||||
example = 1000;
|
example = 1000;
|
||||||
type = with types; int;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
slowLogMaxLen = mkOption {
|
slowLogMaxLen = mkOption {
|
||||||
|
type = types.int;
|
||||||
default = 128;
|
default = 128;
|
||||||
description = "Maximum number of items to keep in slow log.";
|
description = "Maximum number of items to keep in slow log.";
|
||||||
type = with types; int;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
description = "Extra configuration options for redis.conf.";
|
description = "Extra configuration options for redis.conf.";
|
||||||
type = with types; string;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user