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

28 lines
576 B
Nix
Raw Normal View History

2024-02-02 13:45:05 +01:00
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.az-mariadb-for-containers;
in
{
2023-06-05 15:31:45 +02:00
options = {
2024-02-02 13:45:05 +01:00
services.az-mariadb-for-containers.enable = lib.mkEnableOption "Enable MariaDB configured for container clients.";
2023-06-05 15:31:45 +02:00
};
config = lib.mkIf cfg.enable {
services.mysql = {
enable = true;
2023-12-28 20:21:11 +01:00
package = pkgs.mariadb_110;
2024-02-02 13:45:05 +01:00
settings = {
mysqld = {
bind-address = "172.17.0.1";
};
};
};
2024-02-02 13:45:05 +01: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
};
}