mirror of
https://codeberg.org/ultra/nixos-dotfiles.git
synced 2024-11-30 01:03:08 +02:00
36 lines
980 B
Nix
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;
|
|
}
|
|
];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|