nixos-dotfiles/hosts/titan/services/matrix.nix
Alex Stan 0b60064e08 some schtuff
Signed-off-by: Alex Stan <alex.stan.2010@proton.me>
2024-01-20 23:07:14 +02:00

36 lines
980 B
Nix

inputs: { pkgs, ... }: {
services.postgresql.enable = true;
services.postgresql.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";
'';
services.matrix-synapse = {
enable = true;
settings = {
registration_shared_secret_path = "/var/synapse/.synapseregsec";
server_name = "gra.phite.ro";
public_baseurl = "https://matrix.gra.phite.ro";
listeners = [
{
port = 3003;
bind_addresses = [ "127.0.0.1" ];
# Caddy handles HTTPS and TLS
type = "http";
tls = false;
x_forwarded = true;
resources = [
{
names = [ "client" "federation" ];
compress = true;
}
];
}
];
};
};
}