77 lines
1.5 KiB
Nix
77 lines
1.5 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}: let
|
|
fqdn = "matrix.broccoli.town";
|
|
in {
|
|
age.secrets = {
|
|
sliding_sync_env_file.file = ../../secrets/sliding_sync_env_file.age;
|
|
};
|
|
services.postgresql = {
|
|
enable = true;
|
|
ensureUsers = [
|
|
{
|
|
name = "matrix-synapse";
|
|
ensurePermissions = {
|
|
"DATABASE synapse" = "ALL PRIVILEGES";
|
|
};
|
|
}
|
|
];
|
|
authentication = ''
|
|
local all all trust
|
|
'';
|
|
ensureDatabases = [
|
|
"synapse"
|
|
];
|
|
};
|
|
|
|
services.matrix-synapse = {
|
|
enable = true;
|
|
sliding-sync = {
|
|
enable = true;
|
|
environmentFile = config.age.secrets.sliding_sync_env_file.path;
|
|
settings = {
|
|
SYNCV3_SERVER = "http://localhost:8008";
|
|
};
|
|
};
|
|
settings = {
|
|
enable_metrics = true;
|
|
server_name = "broccoli.town";
|
|
database = {
|
|
name = "psycopg2";
|
|
args = {
|
|
database = "synapse";
|
|
user = "matrix-synapse";
|
|
};
|
|
};
|
|
max_upload_size = "50M";
|
|
listeners = [
|
|
{
|
|
port = 8008;
|
|
type = "http";
|
|
tls = false;
|
|
x_forwarded = true;
|
|
resources = [
|
|
{
|
|
names = ["client" "federation"];
|
|
compress = false;
|
|
}
|
|
];
|
|
}
|
|
{
|
|
port = 9000;
|
|
type = "metrics";
|
|
tls = false;
|
|
bind_addresses = [
|
|
"0.0.0.0"
|
|
];
|
|
resources = [
|
|
];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|