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/*: Add types to the database module options #76667
Changes from all commits
117e5bd
7147f92
a758263
15db1e3
ae533c2
815eaf5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,45 +16,46 @@ in | |
|
||
options = { | ||
|
||
services.memcached = { | ||
services.memcached = with types; { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (nitpick, probably irrelevant) I'm not sure if we actually benefit from adding even more |
||
|
||
enable = mkOption { | ||
default = false; | ||
description = " | ||
Whether to enable Memcached. | ||
"; | ||
}; | ||
enable = mkEnableOption "Memcached"; | ||
|
||
user = mkOption { | ||
type = str; | ||
default = "memcached"; | ||
description = "The user to run Memcached as"; | ||
}; | ||
|
||
listen = mkOption { | ||
type = str; | ||
default = "127.0.0.1"; | ||
description = "The IP address to bind to"; | ||
description = "The IP address to bind to."; | ||
}; | ||
|
||
port = mkOption { | ||
type = port; | ||
default = 11211; | ||
description = "The port to bind to"; | ||
description = "The port to bind to."; | ||
}; | ||
|
||
enableUnixSocket = mkEnableOption "unix socket at /run/memcached/memcached.sock"; | ||
|
||
maxMemory = mkOption { | ||
type = ints.unsigned; | ||
default = 64; | ||
description = "The maximum amount of memory to use for storage, in megabytes."; | ||
}; | ||
|
||
maxConnections = mkOption { | ||
type = ints.unsigned; | ||
default = 1024; | ||
description = "The maximum number of simultaneous connections"; | ||
description = "The maximum number of simultaneous connections."; | ||
}; | ||
|
||
extraOptions = mkOption { | ||
type = listOf str; | ||
default = []; | ||
description = "A list of extra options that will be added as a suffix when running memcached"; | ||
description = "A list of extra options that will be added as a suffix when running memcached."; | ||
}; | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,16 +46,12 @@ in | |
|
||
services.redis = { | ||
|
||
enable = mkOption { | ||
type = types.bool; | ||
default = false; | ||
description = '' | ||
Whether to enable the Redis server. Note that the NixOS module for | ||
Redis disables kernel support for Transparent Huge Pages (THP), | ||
because this features causes major performance problems for Redis, | ||
e.g. (https://redis.io/topics/latency). | ||
''; | ||
}; | ||
enable = mkEnableOption '' | ||
Whether to enable the Redis server. Note that the NixOS module for | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Redis disables kernel support for Transparent Huge Pages (THP), | ||
because this features causes major performance problems for Redis, | ||
e.g. (https://redis.io/topics/latency) | ||
''; | ||
|
||
package = mkOption { | ||
type = types.package; | ||
|
@@ -134,12 +130,29 @@ in | |
}; | ||
|
||
slaveOf = mkOption { | ||
default = null; # { ip, port } | ||
description = "An attribute set with two attributes: ip and port to which this redis instance acts as a slave."; | ||
type = with types; nullOr (submodule ({ ... }: { | ||
options = { | ||
ip = mkOption { | ||
type = str; | ||
description = "IP of the Redis master"; | ||
example = "192.168.1.100"; | ||
}; | ||
|
||
port = mkOption { | ||
type = port; | ||
description = "port of the Redis master"; | ||
default = 6379; | ||
}; | ||
}; | ||
})); | ||
|
||
default = null; | ||
description = "IP and port to which this redis instance acts as a slave."; | ||
example = { ip = "192.168.1.100"; port = 6379; }; | ||
}; | ||
|
||
masterAuth = mkOption { | ||
type = types.str; | ||
default = null; | ||
description = ''If the master is password protected (using the requirePass configuration) | ||
it is possible to tell the slave to authenticate before starting the replication synchronization | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we use an int here if that option now represents a port?