mysql service: add some option types
Note that this changes the type and default value of port to int (previously default was a string, no type).
This commit is contained in:
parent
88265c8238
commit
c2153538d9
@ -43,6 +43,7 @@ in
|
|||||||
services.mysql = {
|
services.mysql = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "
|
description = "
|
||||||
Whether to enable the MySQL server.
|
Whether to enable the MySQL server.
|
||||||
@ -58,16 +59,19 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
port = mkOption {
|
port = mkOption {
|
||||||
default = "3306";
|
type = types.int;
|
||||||
|
default = 3306;
|
||||||
description = "Port of MySQL";
|
description = "Port of MySQL";
|
||||||
};
|
};
|
||||||
|
|
||||||
user = mkOption {
|
user = mkOption {
|
||||||
|
type = types.str;
|
||||||
default = "mysql";
|
default = "mysql";
|
||||||
description = "User account under which MySQL runs";
|
description = "User account under which MySQL runs";
|
||||||
};
|
};
|
||||||
|
|
||||||
dataDir = mkOption {
|
dataDir = mkOption {
|
||||||
|
type = types.path;
|
||||||
default = "/var/mysql"; # !!! should be /var/db/mysql
|
default = "/var/mysql"; # !!! should be /var/db/mysql
|
||||||
description = "Location where MySQL stores its table files";
|
description = "Location where MySQL stores its table files";
|
||||||
};
|
};
|
||||||
@ -78,6 +82,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
extraOptions = mkOption {
|
extraOptions = mkOption {
|
||||||
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
example = ''
|
example = ''
|
||||||
key_buffer_size = 6G
|
key_buffer_size = 6G
|
||||||
@ -115,32 +120,39 @@ in
|
|||||||
|
|
||||||
replication = {
|
replication = {
|
||||||
role = mkOption {
|
role = mkOption {
|
||||||
|
type = types.enum [ "master" "slave" "none" ];
|
||||||
default = "none";
|
default = "none";
|
||||||
description = "Role of the MySQL server instance. Can be either: master, slave or none";
|
description = "Role of the MySQL server instance.";
|
||||||
};
|
};
|
||||||
|
|
||||||
serverId = mkOption {
|
serverId = mkOption {
|
||||||
|
type = types.int;
|
||||||
default = 1;
|
default = 1;
|
||||||
description = "Id of the MySQL server instance. This number must be unique for each instance";
|
description = "Id of the MySQL server instance. This number must be unique for each instance";
|
||||||
};
|
};
|
||||||
|
|
||||||
masterHost = mkOption {
|
masterHost = mkOption {
|
||||||
|
type = types.str;
|
||||||
description = "Hostname of the MySQL master server";
|
description = "Hostname of the MySQL master server";
|
||||||
};
|
};
|
||||||
|
|
||||||
slaveHost = mkOption {
|
slaveHost = mkOption {
|
||||||
|
type = types.str;
|
||||||
description = "Hostname of the MySQL slave server";
|
description = "Hostname of the MySQL slave server";
|
||||||
};
|
};
|
||||||
|
|
||||||
masterUser = mkOption {
|
masterUser = mkOption {
|
||||||
|
type = types.str;
|
||||||
description = "Username of the MySQL replication user";
|
description = "Username of the MySQL replication user";
|
||||||
};
|
};
|
||||||
|
|
||||||
masterPassword = mkOption {
|
masterPassword = mkOption {
|
||||||
|
type = types.str;
|
||||||
description = "Password of the MySQL replication user";
|
description = "Password of the MySQL replication user";
|
||||||
};
|
};
|
||||||
|
|
||||||
masterPort = mkOption {
|
masterPort = mkOption {
|
||||||
|
type = types.int;
|
||||||
default = 3306;
|
default = 3306;
|
||||||
description = "Port number on which the MySQL master server runs";
|
description = "Port number on which the MySQL master server runs";
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user