about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMaarten Hoogendoorn <maarten@moretea.nl>2017-06-15 15:10:14 +0200
committerMaarten Hoogendoorn <maarten@moretea.nl>2017-06-15 16:08:15 +0200
commitd847b5c76323cc17f1ebcd3b4f42257930bde0c4 (patch)
treeeb65dbcea15dd755de4f5e003a512a9c67365219 /nixos
parent4010313ab901c9022f564dfdc0e9ef27b595aa53 (diff)
downloadnixlib-d847b5c76323cc17f1ebcd3b4f42257930bde0c4.tar
nixlib-d847b5c76323cc17f1ebcd3b4f42257930bde0c4.tar.gz
nixlib-d847b5c76323cc17f1ebcd3b4f42257930bde0c4.tar.bz2
nixlib-d847b5c76323cc17f1ebcd3b4f42257930bde0c4.tar.lz
nixlib-d847b5c76323cc17f1ebcd3b4f42257930bde0c4.tar.xz
nixlib-d847b5c76323cc17f1ebcd3b4f42257930bde0c4.tar.zst
nixlib-d847b5c76323cc17f1ebcd3b4f42257930bde0c4.zip
mysql module: add option to bind to an address
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/databases/mysql.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix
index bae6b170c472..6027f109285a 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;