2023-06-13 23:05:35 +02:00
|
|
|
{ makeSystem
|
|
|
|
, nixpkgs
|
|
|
|
|
|
|
|
, commonConfig
|
|
|
|
}:
|
|
|
|
makeSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
name = "synapse";
|
|
|
|
inherit nixpkgs;
|
|
|
|
config =
|
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
let
|
|
|
|
inherit (lib)
|
2023-10-07 19:55:39 +02:00
|
|
|
singleton
|
|
|
|
makeSearchPathOutput;
|
2023-06-13 23:05:35 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
dumb-init = {
|
|
|
|
enable = true;
|
|
|
|
type.services = { };
|
|
|
|
};
|
|
|
|
|
2023-10-07 19:55:39 +02:00
|
|
|
services.synapse = {
|
|
|
|
enable = true;
|
|
|
|
package = import ./synapse-package.nix pkgs;
|
|
|
|
settings = {
|
|
|
|
listeners =
|
|
|
|
[
|
|
|
|
# The HTTP replication port
|
|
|
|
{
|
|
|
|
port = 9093;
|
|
|
|
bind_addresses = [ "0.0.0.0" ];
|
|
|
|
type = "http";
|
|
|
|
resources = [
|
|
|
|
{
|
|
|
|
names = [ "replication" ];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
2023-06-13 23:05:35 +02:00
|
|
|
{
|
2023-10-07 19:55:39 +02:00
|
|
|
port = 6167;
|
|
|
|
tls = false;
|
|
|
|
type = "http";
|
|
|
|
x_forwarded = true;
|
|
|
|
bind_adrresses = [ "0.0.0.0" ];
|
|
|
|
resources = singleton {
|
|
|
|
names = [ "client" "federation" ];
|
|
|
|
compress = false;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2023-06-13 23:05:35 +02:00
|
|
|
|
2023-10-07 19:55:39 +02:00
|
|
|
public_baseurl = "https://matrix.redalder.org/";
|
2023-06-13 23:05:35 +02:00
|
|
|
|
2023-10-07 19:55:39 +02:00
|
|
|
# Add a random shared secret to authenticate traffic.
|
|
|
|
worker_replication_secret = "";
|
|
|
|
};
|
|
|
|
arguments = {
|
|
|
|
"config-path" = [
|
|
|
|
(commonConfig pkgs)
|
|
|
|
"/secrets/extra.yaml"
|
|
|
|
"/var/lib/registrations/extra.yaml"
|
|
|
|
];
|
|
|
|
"keys-directory" = "/var/lib/synapse/keys";
|
|
|
|
};
|
2023-06-13 23:05:35 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|