nixos-dotfiles/hosts/hypnos/services/matrix.nix

37 lines
980 B
Nix
Raw Normal View History

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;
}
];
}
];
};
};
}