2023-07-13 16:39:27 +02:00
|
|
|
{
|
2023-11-25 17:12:09 +01:00
|
|
|
config,
|
2023-07-13 16:39:27 +02:00
|
|
|
inputs,
|
2023-11-25 17:12:09 +01:00
|
|
|
lib,
|
|
|
|
pkgs,
|
2023-07-13 16:39:27 +02:00
|
|
|
...
|
2023-11-25 17:12:09 +01:00
|
|
|
}: with lib; let
|
2023-07-30 01:15:35 +02:00
|
|
|
caddyConfig = ''
|
|
|
|
reverse_proxy /_matrix/* localhost:6167
|
|
|
|
header /.well-known/matrix/* Content-Type application/json
|
|
|
|
header /.well-known/matrix/* Access-Control-Allow-Origin *
|
2023-11-25 17:12:09 +01:00
|
|
|
respond /.well-known/matrix/server `{"m.server": "m.jacekpoz.pl:8448"}`
|
2023-07-30 01:15:35 +02:00
|
|
|
respond /.well-known/matrix/client `{"m.homeserver":{"base_url":"https://m.jacekpoz.pl"}}`
|
|
|
|
'';
|
|
|
|
in {
|
2023-10-03 19:22:24 +02:00
|
|
|
environment.systemPackages = with pkgs; [ mautrix-discord ];
|
|
|
|
|
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 = {
|
|
|
|
server_name = "jacekpoz.pl";
|
|
|
|
database_backend = "rocksdb";
|
|
|
|
port = 6167;
|
2023-07-18 20:29:25 +02:00
|
|
|
max_request_size = 100000000;
|
2023-08-02 15:53:56 +02:00
|
|
|
conduit_cache_capacity_modifier = 4.0;
|
2023-08-03 23:59:34 +02:00
|
|
|
rocksdb_max_open_files = 20;
|
|
|
|
allow_check_for_updates = 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;
|
2023-07-30 01:15:35 +02:00
|
|
|
virtualHosts."m.jacekpoz.pl".extraConfig = caddyConfig;
|
|
|
|
virtualHosts."jacekpoz.pl:8448".extraConfig = caddyConfig;
|
2023-07-15 23:41:03 +02:00
|
|
|
};
|
2023-07-13 16:39:27 +02:00
|
|
|
|
2023-08-05 22:04:03 +02:00
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 8448 ];
|
|
|
|
networking.firewall.allowedUDPPorts = [ 80 443 8448 ];
|
2023-07-13 16:39:27 +02:00
|
|
|
}
|