NixOS-Config/modules/system/services/server/social/matrix/synapse/default.nix

58 lines
1.4 KiB
Nix
Raw Normal View History

{ pkgs, config, ... }:
2024-10-09 03:36:08 -04:00
{
imports = [
./coturn
./slidingsync
2024-10-09 03:36:08 -04:00
./nginx
];
services.matrix-synapse = {
enable = true;
settings = {
server_name = "${config.secrets.jimDomain}";
public_baseurl = "https://matrix.${config.secrets.jimDomain}";
suppress_key_server_warning = true;
listeners = [{
port = 8008;
bind_addresses = [ "::" "0.0.0.0" ];
resources = [ { compress = false; names = [ "client" "federation" ]; } ];
type = "http";
tls = false;
x_forwarded = true;
}];
email = {
notif_from = "Jimbo's Matrix <noreply@${config.secrets.jimDomain}>";
smtp_host = "mx.${config.secrets.jimDomain}";
smtp_user = "noreply@${config.secrets.jimDomain}";
smtp_pass = config.secrets.noreplyPassword;
enable_tls = true;
smtp_port = 587;
require_transport_security = true;
};
# Disable registration without email
registrations_require_3pid = [ "email" ];
# Allow only this range of emails
allowed_local_3pids = [{
medium = "email";
pattern = "^[^@]+@jimbosfiles\\.com$";
}];
# Set the type of database
database.name = "sqlite3";
# Allow account registration
enable_registration = true;
# General settings
url_preview_enabled = true;
max_upload_size = "50M";
report_stats = false;
burst_count = 15;
};
};
}