{ config, pkgs, lib, ... }:
let
  fqdn = "matrix.broccoli.town";
in {
  networking.firewall.allowedTCPPorts = [ 80 8448 443 ];

  services.matrix-synapse = {
    enable = true;
    server_name = "broccoli.town";
    database_type = "sqlite3";
    max_upload_size = "50M";
    listeners = [
      {
        port = 8008;
        bind_address = "::1";
        type = "http";
        tls = false;
        x_forwarded = true;
        resources = [
          {
            names = [ "client" "federation" ];
            compress = false;
          }
        ];
      }
    ];
  };
}
