athens/modules/matrix/default.nix

50 lines
1.2 KiB
Nix
Raw Normal View History

2021-06-07 21:15:08 -04:00
{ config, lib, pkgs, ... }:
{
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";
'';
};
matrix-synapse = {
enable = true;
server_name = "walkah.chat";
2021-10-09 21:04:39 -04:00
public_baseurl = "https://matrix.walkah.chat";
2021-06-07 21:15:08 -04:00
enable_metrics = true;
enable_registration = false;
database_type = "psycopg2";
database_args = { database = "matrix"; };
listeners = [{
port = 8008;
type = "http";
tls = false;
x_forwarded = true;
resources = [{
compress = false;
names = [ "client" "federation" ];
}];
}];
extraConfigFiles = [
2021-11-14 22:27:34 -05:00
config.sops.secrets.matrix-registration-secret.path
];
2021-10-09 21:04:39 -04:00
account_threepid_delegates = {
email = "https://vector.im";
msisdn = "https://vector.im";
};
2021-06-07 21:15:08 -04:00
};
};
2021-11-14 22:27:34 -05:00
sops.secrets.matrix-registration-secret = {
owner = "matrix-synapse";
};
2021-06-07 21:15:08 -04:00
}