nixos-config/configs/workhorse/mysql.nix

25 lines
449 B
Nix
Raw Normal View History

2020-09-20 22:54:59 +02:00
{ pkgs, lib, config, ... }: {
2020-09-11 22:25:27 +02:00
services.mysql = {
enable = true;
2020-09-19 21:02:46 +02:00
package = pkgs.mysql80;
2020-09-11 22:25:27 +02:00
initialScript = pkgs.writeText "initScript" ''
CREATE USER 'admin'@'%' IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON * . * TO 'admin'@'%';
'';
};
2020-09-20 22:54:59 +02:00
services.mysqlBackup = {
enable = true;
databases = [
"property"
];
user = "root";
};
backup.dirs = [
config.services.mysqlBackup.location
];
2020-09-11 22:25:27 +02:00
}