Corrected postgres setting for matrix-synapse
This commit is contained in:
parent
60a877c115
commit
d6963248ae
|
@ -8,6 +8,13 @@
|
|||
../secrets/matrix.nix
|
||||
];
|
||||
|
||||
i18n = {
|
||||
extraLocaleSettings = {
|
||||
LC_COLLATE = "C"; # Ensure correct locale for postgres
|
||||
LC_CTYPE = "C"; # Ensure correct locale for postgres
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
|
||||
matrix-synapse = {
|
||||
|
@ -22,7 +29,7 @@
|
|||
resources = [
|
||||
{
|
||||
compress = true;
|
||||
names = [ "client" "webclient" ];
|
||||
names = [ "client" ];
|
||||
} {
|
||||
compress = false;
|
||||
names = [ "federation" ];
|
||||
|
@ -100,20 +107,25 @@
|
|||
|
||||
postgresql = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.postgresql = {
|
||||
ensureDatabases = [ "matrix-synapse" ]; # Ensure the database persists
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "matrix-synapse"; # Ensure the database user persists
|
||||
ensurePermissions = { # Ensure the database permissions persist
|
||||
#"DATABASE \"matrix-synapse\"" = "ALL PRIVILEGES";
|
||||
#"ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
|
||||
"DATABASE \"matrix-synapse\"" = "ALL PRIVILEGES";
|
||||
"ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
];
|
||||
# Initial database creation
|
||||
initialScript = pkgs.writeText "synapse-init.sql" ''
|
||||
CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD 'synapse';
|
||||
CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
|
||||
TEMPLATE template0
|
||||
LC_COLLATE = "C"
|
||||
LC_CTYPE = "C";
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
security.acme = {
|
||||
|
|
Loading…
Reference in a new issue