+m3-atlas
This commit is contained in:
23
hosts/m3-atlas/services/mysql.nix
Normal file
23
hosts/m3-atlas/services/mysql.nix
Normal file
@ -0,0 +1,23 @@
|
||||
{pkgs, ...}: {
|
||||
services.mysql = {
|
||||
enable = true;
|
||||
package = pkgs.mysql84;
|
||||
ensureDatabases = [
|
||||
"ghost"
|
||||
"matomo"
|
||||
];
|
||||
initialScript = pkgs.writeText "initial-script.sql" ''
|
||||
CREATE USER 'ghost'@'10.89.%' IDENTIFIED BY 'ghost';
|
||||
GRANT ALL PRIVILEGES ON ghost.* TO 'ghost'@'10.89.%';
|
||||
|
||||
CREATE USER 'matomo'@'10.89.%' IDENTIFIED BY 'password';
|
||||
GRANT ALL PRIVILEGES ON matomo.* TO 'matomo'@'10.89.%';
|
||||
'';
|
||||
};
|
||||
services.mysqlBackup = {
|
||||
enable = true;
|
||||
calendar = "03:00:00";
|
||||
databases = ["ghost" "matomo"];
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [3306];
|
||||
}
|
Reference in New Issue
Block a user