1
0
Fork 0
pvv-nixos-config/hosts/bicep/services/mysql.nix

31 lines
717 B
Nix
Raw Normal View History

2023-05-18 15:40:13 +02:00
{ pkgs, config, ... }:
{
services.mysql = {
enable = true;
dataDir = "/data/mysql";
package = pkgs.mariadb;
settings = {
mysqld = {
# PVV allows a lot of connections at the same time
max_connect_errors = 10000;
};
};
2023-07-09 23:45:32 +02:00
# Note: This user also has MAX_USER_CONNECTIONS set to 3, and
# a password which can be found in /secrets/ildkule/ildkule.yaml
ensureUsers = [{
name = "prometheus_mysqld_exporter";
ensurePermissions = {
"*.*" = "PROCESS, REPLICATION CLIENT, SELECT";
};
}];
2023-05-18 15:40:13 +02:00
};
services.mysqlBackup = {
enable = true;
location = "/var/lib/mysql/backups";
};
2023-07-09 23:45:32 +02:00
networking.firewall.allowedTCPPorts = [ 3306 ];
2023-05-18 15:40:13 +02:00
}