add a mysql server to test vm
This commit is contained in:
parent
cb44156519
commit
e6fec8642a
|
@ -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");
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue