@@ -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.
@@ -51,6 +52,7 @@ in
5152
5253 package = mkOption {
5354 type = types.package;
55+ default = pkgs.mysql;
5456 example = literalExample "pkgs.mysql";
5557 description = "
5658 Which MySQL derivation to use.
@@ -58,16 +60,19 @@ in
5860 };
5961
6062 port = mkOption {
61− default = "3306";
63+ type = types.int;
64+ default = 3306;
6265 description = "Port of MySQL";
6366 };
6467
6568 user = mkOption {
69+ type = types.str;
6670 default = "mysql";
6771 description = "User account under which MySQL runs";
6872 };
6973
7074 dataDir = mkOption {
75+ type = types.path;
7176 default = "/var/mysql"; # !!! should be /var/db/mysql
7277 description = "Location where MySQL stores its table files";
7378 };
@@ -78,6 +83,7 @@ in
7883 };
7984
8085 extraOptions = mkOption {
86+ type = types.lines;
8187 default = "";
8288 example = ''
8389 key_buffer_size = 6G
@@ -115,32 +121,39 @@ in
115121
116122 replication = {
117123 role = mkOption {
124+ type = types.enum [ "master" "slave" "none" ];
118125 default = "none";
119− description = "Role of the MySQL server instance. Can be either: master, slave or none";
126+ description = "Role of the MySQL server instance.";
120127 };
121128
122129 serverId = mkOption {
130+ type = types.int;
123131 default = 1;
124132 description = "Id of the MySQL server instance. This number must be unique for each instance";
125133 };
126134
127135 masterHost = mkOption {
136+ type = types.str;
128137 description = "Hostname of the MySQL master server";
129138 };
130139
131140 slaveHost = mkOption {
141+ type = types.str;
132142 description = "Hostname of the MySQL slave server";
133143 };
134144
135145 masterUser = mkOption {
146+ type = types.str;
136147 description = "Username of the MySQL replication user";
137148 };
138149
139150 masterPassword = mkOption {
151+ type = types.str;
140152 description = "Password of the MySQL replication user";
141153 };
142154
143155 masterPort = mkOption {
156+ type = types.int;
144157 default = 3306;
145158 description = "Port number on which the MySQL master server runs";
146159 };
@@ -167,6 +180,7 @@ in
167180 systemd.services.mysql =
168181 { description = "MySQL Server";
169182
183+ after = [ "network.target" ];
170184 wantedBy = [ "multi-user.target" ];
171185
172186 unitConfig.RequiresMountsFor = "${cfg.dataDir}";