add a mysql server to test vm

This commit is contained in:
Trolli Schmittlauch 2021-01-31 23:46:56 +01:00
parent cb44156519
commit e6fec8642a

View file

@ -28,8 +28,30 @@
domainName = "seaf.local";
db = {
type = "mysql";
passwordFile = toString (pkgs.writeText "testPW" "lol");
passwordFile = toString (pkgs.writeText "testPW" "test");
};
};
# db backend
services.mysql =
{
enable = true;
package = pkgs.mariadb;
ensureDatabases = [ "ccnet" "seafile" "seahub" ];
ensureUsers = [
rec {
name = config.services.seafile-server.db.user;
ensurePermissions = {
"ccnet.*" = "ALL PRIVILEGES";
"seafile.*" = "ALL PRIVILEGES";
"seahub.*" = "ALL PRIVILEGES";
};
}
];
# set a password for the seafile user
initialScript = pkgs.writeText "mariadb-init.sql" ''
CREATE USER ${config.services.seafile-server.db.user}@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD("test");
'';
};
}