NixOS modules for matrix related services
Go to file
Daniel Lovbrotte Olsen 19b85a2562
Merge pull request #7 from dali99/refactor-nginx-upstream-generation
refactor nginx upstream generation, add support for unix sockets
2024-03-13 06:23:07 +01:00
sliding-sync use nixpkgs sliding sync package 2023-12-02 09:49:03 +01:00
synapse-module treewide: add support for unix sockets 2024-01-27 07:52:26 +01:00
tests generate only one upstream per worker 2024-03-13 06:22:24 +01:00
.gitignore nginx-pipeline: add basic test 2024-01-27 07:52:26 +01:00
COPYING Add a license 2023-02-17 01:16:02 +01:00
MIGRATIONS.MD v0.5.0 2023-12-02 09:58:52 +01:00
README.MD Update README.MD 2023-10-22 03:02:59 +02:00
flake.lock nginx-pipeline: add basic test 2024-01-27 07:52:26 +01:00
flake.nix nginx-pipeline: add basic test 2024-01-27 07:52:26 +01:00
lib.nix generate only one upstream per worker 2024-03-13 06:22:24 +01:00
module.nix Import sliding sync from nixpkgs unstable 2023-09-24 03:32:54 +02:00

README.MD

With matrix.YOURDOMAIN pointing at the server:

{
  imports = [ ./synapse-module ];

  services.matrix-synapse-next = {
    enable = true;

    workers.federationSenders = 1;
    workers.federationReceivers = 1;
    workers.initialSyncers = 1;
    workers.normalSyncers = 1;
    workers.eventPersisters = 2;
    workers.useUserDirectoryWorker = true;

    enableNginx = true;

    settings = {
      server_name = "YOURDOMAIN";
      
      database = {
        name = "psycopg2";
        args = {
          host = "localhost";
          user = "synapse";
          password = "synapse";
          dbname = "synapse";
        };
      };
    };
  };
  
  services.redis.servers."".enable = true;
}

is ~enough to get a functional matrix-server running with some workers

Sliding Sync (Element X)

Just add the following to your config and point slidingsync.YOURDOMAIN at the server

services.matrix-synapse-next = {
  enableSlidingSync = true;
};

services.matrix-synapse.sliding-sync.environmentFile = "/some/file/containing/SYNCV3_SECRET=<some secret>";

If using well-known delagation make sure YOURDOMAIN/.well-known/matrix/client matches what's in matrix.YOURDOMAIN/.well-known/matrix/client