summaryrefslogtreecommitdiff
path: root/config/matrix.nix
blob: 6a57e7681602f22bd174965d59d4e9d52045aac7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ config, lib, pkgs, ... }:
let
  matrixPort = (import ../data/aliases.nix).services.matrix.port;
  matrixFederationPort = (import ../data/aliases.nix).services.matrixFederation.port;
in
{
  networking.firewall.allowedTCPPorts = [ matrixPort matrixFederationPort ];

  services.matrix-synapse = {
    enable = true;
    server_name = "orbekk.com";
    # registration_shared_secret = "disable_after_registration";
    listeners = [
    {
      port = matrixPort;
      bind_address = "";
      type = "http";
      tls = false;
      x_forwarded = true;
      resources = [
        { names = ["client" "webclient"]; compress = true; }
        # { names = ["federation"]; compress = false; }
      ];
    }
    {
      port = matrixFederationPort;
      bind_address = "";
      type = "http";
      tls = true;
      x_forwarded = false;
      resources = [
        { names = ["federation"]; compress = false; }
      ];
    } 
    ];
  };
}