Merge pull request #91813 from Mic92/types1

nixos/*: Add types to the database module options
This commit is contained in:
Kevin Cox 2021-01-14 17:04:54 -05:00 committed by GitHub
commit 5666f34b28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 7 deletions

View File

@ -59,6 +59,7 @@ in
port = mkOption { port = mkOption {
default = "3050"; default = "3050";
type = types.port;
description = '' description = ''
Port Firebird uses. Port Firebird uses.
''; '';
@ -66,6 +67,7 @@ in
user = mkOption { user = mkOption {
default = "firebird"; default = "firebird";
type = types.str;
description = '' description = ''
User account under which firebird runs. User account under which firebird runs.
''; '';
@ -73,6 +75,7 @@ in
baseDir = mkOption { baseDir = mkOption {
default = "/var/db/firebird"; # ubuntu is using /var/lib/firebird/2.1/data/.. ? default = "/var/db/firebird"; # ubuntu is using /var/lib/firebird/2.1/data/.. ?
type = types.str;
description = '' description = ''
Location containing data/ and system/ directories. Location containing data/ and system/ directories.
data/ stores the databases, system/ stores the password database security2.fdb. data/ stores the databases, system/ stores the password database security2.fdb.

View File

@ -17,39 +17,44 @@ in
options = { options = {
services.memcached = { services.memcached = {
enable = mkEnableOption "Memcached"; enable = mkEnableOption "Memcached";
user = mkOption { user = mkOption {
type = types.str;
default = "memcached"; default = "memcached";
description = "The user to run Memcached as"; description = "The user to run Memcached as";
}; };
listen = mkOption { listen = mkOption {
type = types.str;
default = "127.0.0.1"; default = "127.0.0.1";
description = "The IP address to bind to"; description = "The IP address to bind to.";
}; };
port = mkOption { port = mkOption {
type = types.port;
default = 11211; default = 11211;
description = "The port to bind to"; description = "The port to bind to.";
}; };
enableUnixSocket = mkEnableOption "unix socket at /run/memcached/memcached.sock"; enableUnixSocket = mkEnableOption "unix socket at /run/memcached/memcached.sock";
maxMemory = mkOption { maxMemory = mkOption {
type = types.ints.unsigned;
default = 64; default = 64;
description = "The maximum amount of memory to use for storage, in megabytes."; description = "The maximum amount of memory to use for storage, in megabytes.";
}; };
maxConnections = mkOption { maxConnections = mkOption {
type = types.ints.unsigned;
default = 1024; default = 1024;
description = "The maximum number of simultaneous connections"; description = "The maximum number of simultaneous connections.";
}; };
extraOptions = mkOption { extraOptions = mkOption {
type = types.listOf types.str;
default = []; 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.";
}; };
}; };

View File

@ -41,16 +41,19 @@ in
}; };
user = mkOption { user = mkOption {
type = types.str;
default = "mongodb"; default = "mongodb";
description = "User account under which MongoDB runs"; description = "User account under which MongoDB runs";
}; };
bind_ip = mkOption { bind_ip = mkOption {
type = types.str;
default = "127.0.0.1"; default = "127.0.0.1";
description = "IP to bind to"; description = "IP to bind to";
}; };
quiet = mkOption { quiet = mkOption {
type = types.bool;
default = false; default = false;
description = "quieter output"; description = "quieter output";
}; };
@ -68,16 +71,19 @@ in
}; };
dbpath = mkOption { dbpath = mkOption {
type = types.str;
default = "/var/db/mongodb"; default = "/var/db/mongodb";
description = "Location where MongoDB stores its files"; description = "Location where MongoDB stores its files";
}; };
pidFile = mkOption { pidFile = mkOption {
type = types.str;
default = "/run/mongodb.pid"; default = "/run/mongodb.pid";
description = "Location of MongoDB pid file"; description = "Location of MongoDB pid file";
}; };
replSetName = mkOption { replSetName = mkOption {
type = types.str;
default = ""; default = "";
description = '' description = ''
If this instance is part of a replica set, set its name here. If this instance is part of a replica set, set its name here.
@ -86,6 +92,7 @@ in
}; };
extraConfig = mkOption { extraConfig = mkOption {
type = types.lines;
default = ""; default = "";
example = '' example = ''
storage.journal.enabled: false storage.journal.enabled: false

View File

@ -122,12 +122,29 @@ in
}; };
slaveOf = mkOption { slaveOf = mkOption {
default = null; # { ip, port } type = with types; nullOr (submodule ({ ... }: {
description = "An attribute set with two attributes: ip and port to which this redis instance acts as a slave."; 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; }; example = { ip = "192.168.1.100"; port = 6379; };
}; };
masterAuth = mkOption { masterAuth = mkOption {
type = types.str;
default = null; default = null;
description = ''If the master is password protected (using the requirePass configuration) 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 it is possible to tell the slave to authenticate before starting the replication synchronization

View File

@ -16,28 +16,33 @@ with lib;
enable = mkEnableOption "Virtuoso Opensource database server"; enable = mkEnableOption "Virtuoso Opensource database server";
config = mkOption { config = mkOption {
type = types.lines;
default = ""; default = "";
description = "Extra options to put into Virtuoso configuration file."; description = "Extra options to put into Virtuoso configuration file.";
}; };
parameters = mkOption { parameters = mkOption {
type = types.lines;
default = ""; default = "";
description = "Extra options to put into [Parameters] section of Virtuoso configuration file."; description = "Extra options to put into [Parameters] section of Virtuoso configuration file.";
}; };
listenAddress = mkOption { listenAddress = mkOption {
type = types.str;
default = "1111"; default = "1111";
example = "myserver:1323"; example = "myserver:1323";
description = "ip:port or port to listen on."; description = "ip:port or port to listen on.";
}; };
httpListenAddress = mkOption { httpListenAddress = mkOption {
type = types.nullOr types.str;
default = null; default = null;
example = "myserver:8080"; example = "myserver:8080";
description = "ip:port or port for Virtuoso HTTP server to listen on."; description = "ip:port or port for Virtuoso HTTP server to listen on.";
}; };
dirsAllowed = mkOption { dirsAllowed = mkOption {
type = types.nullOr types.str; # XXX Maybe use a list in the future?
default = null; default = null;
example = "/www, /home/"; example = "/www, /home/";
description = "A list of directories Virtuoso is allowed to access"; description = "A list of directories Virtuoso is allowed to access";