summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorJoachim F <joachifm@users.noreply.github.com>2016-10-04 22:30:53 +0200
committerGitHub <noreply@github.com>2016-10-04 22:30:53 +0200
commit94cf6b2d562283debbc8f03d048196f76671499b (patch)
tree9f24fc1d4fb8981acf6f63f7d3e0605ddd4406d6 /nixos/modules
parent98a750b4a8efd62a823e7dcd8209be879f4ae926 (diff)
parent4358d3d43938666834d3e1fd5a8ea69b49c08112 (diff)
downloadnixlib-94cf6b2d562283debbc8f03d048196f76671499b.tar
nixlib-94cf6b2d562283debbc8f03d048196f76671499b.tar.gz
nixlib-94cf6b2d562283debbc8f03d048196f76671499b.tar.bz2
nixlib-94cf6b2d562283debbc8f03d048196f76671499b.tar.lz
nixlib-94cf6b2d562283debbc8f03d048196f76671499b.tar.xz
nixlib-94cf6b2d562283debbc8f03d048196f76671499b.tar.zst
nixlib-94cf6b2d562283debbc8f03d048196f76671499b.zip
Merge pull request #19210 from joachifm/mysql
Some light mysql service enhancements
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/databases/mysql.nix18
1 files changed, 16 insertions, 2 deletions
diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix
index 0b2f99f8fff1..e5e8a57f4b0e 100644
--- a/nixos/modules/services/databases/mysql.nix
+++ b/nixos/modules/services/databases/mysql.nix
@@ -43,6 +43,7 @@ in
     services.mysql = {
 
       enable = mkOption {
+        type = types.bool;
         default = false;
         description = "
           Whether to enable the MySQL server.
@@ -51,6 +52,7 @@ in
 
       package = mkOption {
         type = types.package;
+        default = pkgs.mysql;
         example = literalExample "pkgs.mysql";
         description = "
           Which MySQL derivation to use.
@@ -58,16 +60,19 @@ in
       };
 
       port = mkOption {
-        default = "3306";
+        type = types.int;
+        default = 3306;
         description = "Port of MySQL";
       };
 
       user = mkOption {
+        type = types.str;
         default = "mysql";
         description = "User account under which MySQL runs";
       };
 
       dataDir = mkOption {
+        type = types.path;
         default = "/var/mysql"; # !!! should be /var/db/mysql
         description = "Location where MySQL stores its table files";
       };
@@ -78,6 +83,7 @@ in
       };
 
       extraOptions = mkOption {
+        type = types.lines;
         default = "";
         example = ''
           key_buffer_size = 6G
@@ -115,32 +121,39 @@ in
 
       replication = {
         role = mkOption {
+          type = types.enum [ "master" "slave" "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 {
+          type = types.int;
           default = 1;
           description = "Id of the MySQL server instance. This number must be unique for each instance";
         };
 
         masterHost = mkOption {
+          type = types.str;
           description = "Hostname of the MySQL master server";
         };
 
         slaveHost = mkOption {
+          type = types.str;
           description = "Hostname of the MySQL slave server";
         };
 
         masterUser = mkOption {
+          type = types.str;
           description = "Username of the MySQL replication user";
         };
 
         masterPassword = mkOption {
+          type = types.str;
           description = "Password of the MySQL replication user";
         };
 
         masterPort = mkOption {
+          type = types.int;
           default = 3306;
           description = "Port number on which the MySQL master server runs";
         };
@@ -167,6 +180,7 @@ in
     systemd.services.mysql =
       { description = "MySQL Server";
 
+        after = [ "network.target" ];
         wantedBy = [ "multi-user.target" ];
 
         unitConfig.RequiresMountsFor = "${cfg.dataDir}";