'';
};
port = lib.mkOption {
- type = lib.types.str;
+ type = lib.types.int;
description = ''
Port to connect to
'';
};
config = lib.mkIf cfg.enable {
+ myServices.chatonsProperties.hostings.mysql-replication = {
+ file.datetime = "2022-08-27T15:00:00";
+ hosting = {
+ name = "Mysql replication";
+ description = "Replication of mysql database";
+ website = "db-1.immae.eu";
+ status.level = "OK";
+ status.description = "OK";
+ registration.load = "OPEN";
+ install.type = "PACKAGE";
+ };
+ software = {
+ name = "MariaDB";
+ website = "https://mariadb.org/";
+ license.url = "https://github.com/MariaDB/server/blob/10.11/COPYING";
+ license.name = "GNU General Public License v2.0";
+ version = pkgs.mariadb.version;
+ source.url = "https://github.com/MariaDB/server";
+ };
+ };
users.users.mysql = {
description = "MySQL server user";
group = "mysql";
group = "mysql";
permissions = "0400";
text = ''
- CHANGE MASTER TO master_host="${hcfg.host}", master_port=${hcfg.port}, master_user="${hcfg.user}", master_password="${hcfg.password}", master_ssl=1, master_use_gtid=slave_pos;
+ CHANGE MASTER TO master_host="${hcfg.host}", master_port=${builtins.toString hcfg.port}, master_user="${hcfg.user}", master_password="${hcfg.password}", master_ssl=1, master_use_gtid=slave_pos;
START SLAVE;
'';
})
${hcfg.package}/bin/mysqldump \
--defaults-file=${config.secrets.fullPaths."mysql_replication/${name}/mysqldump_remote"} \
-h ${hcfg.host} \
- -P ${hcfg.port} \
+ -P ${builtins.toString hcfg.port} \
--ssl \
--gtid \
--flush-privileges \