2023-07-13 16:39:27 +02:00
|
|
|
{
|
|
|
|
inputs,
|
2023-11-25 17:12:09 +01:00
|
|
|
pkgs,
|
2023-07-13 16:39:27 +02:00
|
|
|
...
|
2024-07-16 08:07:53 +02:00
|
|
|
}: let
|
2024-04-14 18:49:29 +02:00
|
|
|
port = 6167;
|
|
|
|
in {
|
2024-08-25 20:17:14 +02:00
|
|
|
environment.systemPackages = [ pkgs.mautrix-discord ];
|
2023-10-03 19:22:24 +02:00
|
|
|
|
2023-07-15 23:41:03 +02:00
|
|
|
services.matrix-conduit = {
|
|
|
|
enable = true;
|
2023-07-17 21:42:19 +02:00
|
|
|
package = inputs.conduit.packages.${pkgs.system}.default;
|
2023-07-17 20:03:22 +02:00
|
|
|
|
2023-07-15 23:41:03 +02:00
|
|
|
settings.global = {
|
2024-01-20 01:26:50 +01:00
|
|
|
address = "127.0.0.1";
|
2023-07-15 23:41:03 +02:00
|
|
|
server_name = "jacekpoz.pl";
|
|
|
|
database_backend = "rocksdb";
|
2024-04-14 18:49:29 +02:00
|
|
|
inherit port;
|
2024-07-22 17:27:48 +02:00
|
|
|
enable_lightning_bolt = false;
|
|
|
|
max_request_size = 104857600;
|
2023-08-03 23:59:34 +02:00
|
|
|
allow_check_for_updates = false;
|
2024-01-20 01:26:50 +01:00
|
|
|
allow_registration = false;
|
2023-07-15 23:41:03 +02:00
|
|
|
};
|
2023-07-13 16:39:27 +02:00
|
|
|
};
|
|
|
|
|
2023-07-15 23:41:03 +02:00
|
|
|
services.caddy = {
|
|
|
|
enable = true;
|
2024-01-20 01:26:50 +01:00
|
|
|
virtualHosts."m.jacekpoz.pl".extraConfig = ''
|
2024-04-14 18:49:29 +02:00
|
|
|
reverse_proxy /_matrix/* 127.0.0.1:${toString port}
|
2024-01-20 01:26:50 +01:00
|
|
|
'';
|
|
|
|
virtualHosts."jacekpoz.pl".extraConfig = ''
|
|
|
|
header /.well-known/matrix/* Content-Type application/json
|
|
|
|
header /.well-known/matrix/* Access-Control-Allow-Origin *
|
|
|
|
|
|
|
|
respond /.well-known/matrix/server `{
|
2024-05-16 17:33:16 +02:00
|
|
|
"m.server": "m.jacekpoz.pl:443"
|
2024-01-20 01:26:50 +01:00
|
|
|
}`
|
|
|
|
respond /.well-known/matrix/client `{
|
|
|
|
"m.homeserver": {
|
|
|
|
"base_url": "https://m.jacekpoz.pl"
|
|
|
|
},
|
|
|
|
"m.identity_server": {
|
|
|
|
"base_url": "https://matrix.org"
|
|
|
|
},
|
|
|
|
"org.matrix.msc3575.proxy": {
|
|
|
|
"url": "https://m.jacekpoz.pl"
|
|
|
|
}
|
|
|
|
}`
|
|
|
|
'';
|
2023-07-15 23:41:03 +02:00
|
|
|
};
|
2023-07-13 16:39:27 +02:00
|
|
|
|
2024-01-27 19:10:17 +01:00
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
|
|
networking.firewall.allowedUDPPorts = [ 80 443 ];
|
2023-07-13 16:39:27 +02:00
|
|
|
}
|