Add postgresql support to matrix-synapse
This commit is contained in:
parent
8505cd07a9
commit
8504c06610
@ -13,14 +13,18 @@ in {
|
|||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
|
enableElementWeb = lib.mkOption {
|
||||||
|
default = true;
|
||||||
|
example = false;
|
||||||
|
};
|
||||||
serverName = lib.mkOption {
|
serverName = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "vimium.com";
|
default = "vimium.com";
|
||||||
example = "vimium.com";
|
example = "vimium.com";
|
||||||
};
|
};
|
||||||
enableElementWeb = lib.mkOption {
|
usePostgres = lib.mkOption {
|
||||||
default = true;
|
default = false;
|
||||||
example = false;
|
example = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -125,7 +129,7 @@ in {
|
|||||||
services.matrix-synapse = {
|
services.matrix-synapse = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
database.name = "sqlite3";
|
database.name = (if cfg.usePostgres then "psycopg2" else "sqlite3");
|
||||||
enable_metrics = false;
|
enable_metrics = false;
|
||||||
enable_registration = false;
|
enable_registration = false;
|
||||||
max_upload_size = "100M";
|
max_upload_size = "100M";
|
||||||
@ -133,5 +137,17 @@ in {
|
|||||||
server_name = cfg.serverName;
|
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