From 88265c8238ddee421eea6251d4579d173b0a9332 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Sun, 2 Oct 2016 22:17:20 +0200 Subject: mysql service: order after network.target --- nixos/modules/services/databases/mysql.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'nixos/modules') diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix index 0b2f99f8fff1..6cc2c77c63b8 100644 --- a/nixos/modules/services/databases/mysql.nix +++ b/nixos/modules/services/databases/mysql.nix @@ -167,6 +167,7 @@ in systemd.services.mysql = { description = "MySQL Server"; + after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; unitConfig.RequiresMountsFor = "${cfg.dataDir}"; -- cgit 1.4.1 From c2153538d9830071f01ed968190c69c50dfaaaa8 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Sun, 2 Oct 2016 22:34:29 +0200 Subject: 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). --- nixos/modules/services/databases/mysql.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix index 6cc2c77c63b8..fcf1f123cfb5 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. @@ -58,16 +59,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 +82,7 @@ in }; extraOptions = mkOption { + type = types.lines; default = ""; example = '' key_buffer_size = 6G @@ -115,32 +120,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"; }; -- cgit 1.4.1 From 4358d3d43938666834d3e1fd5a8ea69b49c08112 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Sun, 2 Oct 2016 22:46:58 +0200 Subject: mysql service: specify a default package A config ought to be buildable using just the defaults. --- nixos/modules/services/databases/mysql.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'nixos/modules') diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix index fcf1f123cfb5..e5e8a57f4b0e 100644 --- a/nixos/modules/services/databases/mysql.nix +++ b/nixos/modules/services/databases/mysql.nix @@ -52,6 +52,7 @@ in package = mkOption { type = types.package; + default = pkgs.mysql; example = literalExample "pkgs.mysql"; description = " Which MySQL derivation to use. -- cgit 1.4.1