From 9a1b53304a39bb48481b2882c3954a7f5ea5d20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Wed, 31 Oct 2018 00:02:27 +0100 Subject: [PATCH] nixos/mysql: Support bootstrapping a Galera cluster The default galera_new_cluster script tries to set this environment variable using systemctl set-environment which doesn't work if the variable is not being used in the unit file ;) --- nixos/modules/services/databases/mysql.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix index 1ba878957ed..8e7945cfdb5 100644 --- a/nixos/modules/services/databases/mysql.nix +++ b/nixos/modules/services/databases/mysql.nix @@ -274,7 +274,8 @@ in serviceConfig = { Type = if hasNotify then "notify" else "simple"; RuntimeDirectory = "mysqld"; - ExecStart = "${mysql}/bin/mysqld --defaults-file=/etc/my.cnf ${mysqldOptions}"; + # The last two environment variables are used for starting Galera clusters + ExecStart = "${mysql}/bin/mysqld --defaults-file=/etc/my.cnf ${mysqldOptions} $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION"; }; postStart = ''