stockholm/lass/2configs/matrix.nix

63 lines
1.6 KiB
Nix
Raw Normal View History

2023-06-26 10:55:25 +00:00
{ config, pkgs, ... }:
with import <stockholm/lib>;
{
services.matrix-synapse = {
enable = true;
settings = {
server_name = "lassul.us";
# registration_shared_secret = "yolo";
database.name = "sqlite3";
turn_uris = [
"turn:turn.matrix.org?transport=udp"
"turn:turn.matrix.org?transport=tcp"
];
listeners = [
{
port = 8008;
bind_addresses = [ "::1" ];
type = "http";
tls = false;
x_forwarded = true;
resources = [
{
names = [ "client" ];
compress = true;
}
{
names = [ "federation" ];
2023-09-03 10:07:17 +00:00
compress = true;
2023-06-26 10:55:25 +00:00
}
];
}
];
};
};
services.nginx = {
virtualHosts = {
"lassul.us" = {
locations."= /.well-known/matrix/server".extraConfig = ''
add_header Content-Type application/json;
return 200 '${builtins.toJSON {
"m.server" = "matrix.lassul.us:443";
}}';
'';
locations."= /.well-known/matrix/client".extraConfig = ''
add_header Content-Type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '${builtins.toJSON {
"m.homeserver" = { "base_url" = "https://matrix.lassul.us"; };
"m.identity_server" = { "base_url" = "https://vector.im"; };
}}';
'';
};
"matrix.lassul.us" = {
forceSSL = true;
enableACME = true;
locations."/_matrix" = {
proxyPass = "http://[::1]:8008";
};
};
};
};
}