services: matrix: make sure db and role exist

This commit is contained in:
Antoine Martin 2022-06-12 21:00:36 +02:00
parent 9593e8b460
commit 82624606db

View file

@ -53,6 +53,14 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.postgresql = { services.postgresql = {
enable = true; enable = true;
ensureDatabases = ["matrix-synapse"];
ensureUsers = [
{
name = "matrix-synapse";
ensurePermissions."DATABASE 'matrix-synapse'" = "ALL PRIVILEGES";
}
];
}; };
services.postgresqlBackup = { services.postgresqlBackup = {