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 950f80ea..d9b101c5 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 00000000..0d7cc1ba --- /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"; + }; +}