athens/modules/matrix/default.nix

68 lines
1.6 KiB
Nix
Raw Normal View History

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";
'';
};
2023-07-09 19:58:59 -04: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";
args = { database = "matrix"; };
};
listeners = [{
bind_addresses = [
"0.0.0.0"
];
port = 8008;
type = "http";
tls = false;
x_forwarded = true;
resources = [{
compress = false;
names = [ "client" "federation" ];
}];
2021-06-07 21:15:08 -04:00
}];
2022-03-24 15:43:48 -04:00
};
extraConfigFiles = [
2021-11-14 22:27:34 -05:00
config.sops.secrets.matrix-registration-secret.path
];
};
2023-07-09 19:58:59 -04:00
matrix-sliding-sync = {
enable = true;
settings = {
SYNCV3_SERVER = "https://matrix.walkah.chat";
SYNCV3_BINDADDR = "0.0.0.0:8088";
};
environmentFile = config.sops.secrets.matrix-sliding-sync-secret.path;
};
2021-06-07 21:15:08 -04:00
};
2022-03-24 15:43:48 -04:00
sops.secrets.matrix-registration-secret = {
owner = "matrix-synapse";
};
sops.secrets.matrix-sliding-sync-secret = { };
2021-06-07 21:15:08 -04:00
}