nixos-config/nixos/configs/workhorse/mysql.nix

21 lines
435 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;
2020-09-21 23:03:55 +02:00
databases = [ "property" ];
2021-03-03 06:45:08 +01:00
#user = "admin";
2020-09-20 22:54:59 +02:00
};
2020-09-21 23:03:55 +02:00
backup.dirs = [ config.services.mysqlBackup.location ];
2020-09-20 22:54:59 +02:00
2020-09-11 22:25:27 +02:00
}