{ config, pkgs, lib, ... }: { imports = [ ../../modules/base-server.nix ../../modules/packages/ooye/packages/module.nix ]; networking = { hostName = "matrix"; interfaces.ens18.ipv4.addresses = [ { address = "10.10.0.3"; prefixLength = 8; } ]; defaultGateway.interface = "ens18"; }; services = { matrix-ooye = { enable = true; enableSynapseIntegration = true; }; postgresql = { enable = true; package = pkgs.postgresql_16; enableTCPIP = true; authentication = pkgs.lib.mkOverride 10 '' # TYPE, DATABASE, USER, ADDRESS, METHOD local all all trust host all all 127.0.0.1/32 trust host all all ::1/128 trust host matrix-synapse matrix-synapse 127.0.0.1/32 trust host all all 0.0.0.0/0 md5 ''; settings = { max_connections = 250; superuser_reserved_connections = 3; }; }; matrix-synapse = { enable = true; withJemalloc = true; # https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html settings = { server_name = "localhost"; enable_registration = true; registration_requires_token = false; federation = { client_timeout = "60s"; max_short_retries = 6; max_short_retry_delay = "10s"; max_long_retries = 5; max_long_retry_delay = "30s"; }; registration_shared_secret = "test"; #listeners = [ # { # port = 8008; # bind_addresses = [ "127.0.0.1" ]; # type = "http"; # tls = false; # x_forwarded = true; # resources = [ # { # names = [ # "client" # "federation" # ]; # compress = true; # } # ]; # } # { # type = "http"; # path = "/run/matrix-synapse/main-http.sock"; # mode = "666"; # resources = [ # { # names = [ # "client" # "federation" # ]; # compress = false; # } # ]; # } #]; dynamic_thumbnails = true; presence = { enable = true; update_interval = 60; }; url_preview_enabled = true; database = { name = "psycopg2"; args = { user = "matrix-synapse"; password = "somepassword"; database = "matrix-synapse"; host = "127.0.0.1"; application_name = "matrix-synapse (litenet.tel)"; cp_min = 5; cp_max = 50; }; }; max_image_pixels = "100M"; report_stats = false; }; }; }; system.stateVersion = "22.11"; # DO NOT EDIT! }