2022-12-27 10:10:53 -05:00
|
|
|
{ config, pkgs, ... }:
|
2021-06-07 21:15:08 -04:00
|
|
|
|
|
|
|
{
|
2023-02-03 18:58:29 -05:00
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
matrix-synapse-tools.synadm
|
|
|
|
];
|
|
|
|
|
2021-06-07 21:15:08 -04:00
|
|
|
services = {
|
|
|
|
postgresql = {
|
|
|
|
enable = true;
|
|
|
|
initialScript = pkgs.writeText "synapse-init.sql" ''
|
|
|
|
CREATE ROLE "matrix-synapse";
|
|
|
|
CREATE DATABASE "matrix" WITH OWNER "matrix-synapse"
|
|
|
|
TEMPLATE template0
|
|
|
|
ENCODING 'UTF8'
|
|
|
|
LC_COLLATE = "C"
|
|
|
|
LC_CTYPE = "C";
|
|
|
|
'';
|
|
|
|
};
|
2024-12-07 20:46:15 -05:00
|
|
|
postgresqlBackup.databases = [
|
|
|
|
"matrix"
|
|
|
|
"matrix-syncv3"
|
|
|
|
];
|
2021-06-07 21:15:08 -04:00
|
|
|
|
|
|
|
matrix-synapse = {
|
|
|
|
enable = true;
|
2022-03-24 15:43:48 -04:00
|
|
|
settings = {
|
|
|
|
server_name = "walkah.chat";
|
|
|
|
public_baseurl = "https://matrix.walkah.chat";
|
|
|
|
enable_metrics = true;
|
|
|
|
enable_registration = false;
|
|
|
|
database = {
|
|
|
|
name = "psycopg2";
|
2024-12-07 20:46:15 -05:00
|
|
|
args = {
|
|
|
|
database = "matrix";
|
|
|
|
};
|
2022-03-24 15:43:48 -04:00
|
|
|
};
|
2024-12-07 20:46:15 -05:00
|
|
|
listeners = [
|
|
|
|
{
|
|
|
|
bind_addresses = [
|
|
|
|
"0.0.0.0"
|
|
|
|
];
|
|
|
|
port = 8008;
|
|
|
|
type = "http";
|
|
|
|
tls = false;
|
|
|
|
x_forwarded = true;
|
|
|
|
resources = [
|
|
|
|
{
|
|
|
|
compress = false;
|
|
|
|
names = [
|
|
|
|
"client"
|
|
|
|
"federation"
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
2022-03-24 15:43:48 -04:00
|
|
|
};
|
2021-11-14 14:16:56 -05:00
|
|
|
extraConfigFiles = [
|
2021-11-14 22:27:34 -05:00
|
|
|
config.sops.secrets.matrix-registration-secret.path
|
2021-11-14 14:16:56 -05:00
|
|
|
];
|
2024-01-01 17:22:30 -05:00
|
|
|
};
|
2021-06-07 21:15:08 -04:00
|
|
|
};
|
2021-11-14 14:16:56 -05:00
|
|
|
|
2022-03-24 15:43:48 -04:00
|
|
|
sops.secrets.matrix-registration-secret = {
|
2021-11-14 14:16:56 -05:00
|
|
|
owner = "matrix-synapse";
|
|
|
|
};
|
2021-06-07 21:15:08 -04:00
|
|
|
}
|