nixos/modules/services/mariadb-for-containers/default.nix

23 lines
564 B
Nix
Raw Normal View History

2023-06-05 15:31:45 +02:00
{ config, lib, pkgs, ... }:
let
cfg = config.services.az-mariadb-for-containers;
in
2022-05-23 15:59:07 +02:00
{
2023-06-05 15:31:45 +02:00
options = {
services.az-mariadb-for-containers.enable = lib.mkEnableOption "Enable MariaDB configured for container clients.";
};
config = lib.mkIf cfg.enable {
services.mysql = {
enable = true;
package = pkgs.mariadb;
settings = {
mysqld = {
bind-address = "172.17.0.1";
};
};
};
2023-06-05 15:31:45 +02:00
networking.firewall.extraCommands = "iptables -A INPUT -p tcp --destination-port 3306 -s 172.16.0.0/12 -j ACCEPT";
2022-05-23 15:59:07 +02:00
};
}