git.iko.soy/typeable/nixpkgs
on master help sign in
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).

commitc2153538d9830071f01ed968190c69c50dfaaaa8 authorJoachim Fasting <joachifm@fastmail.fm> dateSun 2 Oct 2016, 22:34 (10 years ago) parent88265c8
1 file changed+14−2
nixos/modules/services/databases/mysql.nix+14−2
nixos/modules/services/databases/mysql.nix+14−2
@@ -43,6 +43,7 @@ in
4343 services.mysql = {
4444
4545 enable = mkOption {
46+ type = types.bool;
4647 default = false;
4748 description = "
4849 Whether to enable the MySQL server.
@@ -58,16 +59,19 @@ in
5859 };
5960
6061 port = mkOption {
61− default = "3306";
62+ type = types.int;
63+ default = 3306;
6264 description = "Port of MySQL";
6365 };
6466
6567 user = mkOption {
68+ type = types.str;
6669 default = "mysql";
6770 description = "User account under which MySQL runs";
6871 };
6972
7073 dataDir = mkOption {
74+ type = types.path;
7175 default = "/var/mysql"; # !!! should be /var/db/mysql
7276 description = "Location where MySQL stores its table files";
7377 };
@@ -78,6 +82,7 @@ in
7882 };
7983
8084 extraOptions = mkOption {
85+ type = types.lines;
8186 default = "";
8287 example = ''
8388 key_buffer_size = 6G
@@ -115,32 +120,39 @@ in
115120
116121 replication = {
117122 role = mkOption {
123+ type = types.enum [ "master" "slave" "none" ];
118124 default = "none";
119− description = "Role of the MySQL server instance. Can be either: master, slave or none";
125+ description = "Role of the MySQL server instance.";
120126 };
121127
122128 serverId = mkOption {
129+ type = types.int;
123130 default = 1;
124131 description = "Id of the MySQL server instance. This number must be unique for each instance";
125132 };
126133
127134 masterHost = mkOption {
135+ type = types.str;
128136 description = "Hostname of the MySQL master server";
129137 };
130138
131139 slaveHost = mkOption {
140+ type = types.str;
132141 description = "Hostname of the MySQL slave server";
133142 };
134143
135144 masterUser = mkOption {
145+ type = types.str;
136146 description = "Username of the MySQL replication user";
137147 };
138148
139149 masterPassword = mkOption {
150+ type = types.str;
140151 description = "Password of the MySQL replication user";
141152 };
142153
143154 masterPort = mkOption {
155+ type = types.int;
144156 default = 3306;
145157 description = "Port number on which the MySQL master server runs";
146158 };