Add postgresql support to matrix-synapse
This commit is contained in:
parent
8505cd07a9
commit
8504c06610
@ -13,14 +13,18 @@ in {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
enableElementWeb = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
};
|
||||
serverName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "vimium.com";
|
||||
example = "vimium.com";
|
||||
};
|
||||
enableElementWeb = lib.mkOption {
|
||||
default = true;
|
||||
example = false;
|
||||
usePostgres = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
};
|
||||
|
||||
@ -125,7 +129,7 @@ in {
|
||||
services.matrix-synapse = {
|
||||
enable = true;
|
||||
settings = {
|
||||
database.name = "sqlite3";
|
||||
database.name = (if cfg.usePostgres then "psycopg2" else "sqlite3");
|
||||
enable_metrics = false;
|
||||
enable_registration = false;
|
||||
max_upload_size = "100M";
|
||||
@ -133,5 +137,17 @@ in {
|
||||
server_name = cfg.serverName;
|
||||
};
|
||||
};
|
||||
|
||||
services.postgresql = lib.mkIf cfg.usePostgres {
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "matrix-synapse";
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
];
|
||||
ensureDatabases = [
|
||||
"matrix-synapse"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user