From c11a804097948f9290b4c6972501d523048b7aa8 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Thu, 18 May 2023 15:40:13 +0200 Subject: [PATCH] bicep: set up mysql/mariadb --- hosts/bicep/configuration.nix | 1 + hosts/bicep/services/mysql.nix | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 hosts/bicep/services/mysql.nix diff --git a/hosts/bicep/configuration.nix b/hosts/bicep/configuration.nix index 950f80e..d9b101c 100644 --- a/hosts/bicep/configuration.nix +++ b/hosts/bicep/configuration.nix @@ -6,6 +6,7 @@ ../../base.nix ./services/nginx + ./services/mysql.nix ./services/postgres.nix ./services/matrix diff --git a/hosts/bicep/services/mysql.nix b/hosts/bicep/services/mysql.nix new file mode 100644 index 0000000..0d7cc1b --- /dev/null +++ b/hosts/bicep/services/mysql.nix @@ -0,0 +1,19 @@ +{ 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; + }; + }; + }; + + services.mysqlBackup = { + enable = true; + location = "/var/lib/mysql/backups"; + }; +}