From d847b5c76323cc17f1ebcd3b4f42257930bde0c4 Mon Sep 17 00:00:00 2001 From: Maarten Hoogendoorn Date: Thu, 15 Jun 2017 15:10:14 +0200 Subject: [PATCH] mysql module: add option to bind to an address --- nixos/modules/services/databases/mysql.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix index bae6b170c47..6027f109285 100644 --- a/nixos/modules/services/databases/mysql.nix +++ b/nixos/modules/services/databases/mysql.nix @@ -20,6 +20,7 @@ let '' [mysqld] port = ${toString cfg.port} + ${optionalString (cfg.bind != null) "bind-address = ${cfg.bind}" } ${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "log-bin=mysql-bin"} ${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "server-id = ${toString cfg.replication.serverId}"} ${optionalString (cfg.replication.role == "slave" && !atLeast55) @@ -58,6 +59,13 @@ in "; }; + bind = mkOption { + type = types.nullOr types.str; + default = null; + example = literalExample "0.0.0.0"; + description = "Address to bind to. The default it to bind to all addresses"; + }; + port = mkOption { type = types.int; default = 3306;