mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 11:36:16 +01:00
c1a727a699
Signed-off-by: Magic_RB <magic_rb@redalder.org>
60 lines
1.3 KiB
Nix
60 lines
1.3 KiB
Nix
{ makeSystem
|
|
, nixpkgs
|
|
|
|
, listener_resources
|
|
, name
|
|
, logConfig
|
|
, commonConfig
|
|
}:
|
|
makeSystem {
|
|
system = "x86_64-linux";
|
|
name = "synapse-worker-${name}";
|
|
inherit nixpkgs;
|
|
config = ({ pkgs, ... }:
|
|
{
|
|
dumb-init = {
|
|
enable = true;
|
|
type.services = { };
|
|
};
|
|
|
|
services.synapse.workers.${name} = {
|
|
settings = {
|
|
worker_app = "synapse.app.generic_worker";
|
|
|
|
# The replication listener on the main synapse process.
|
|
worker_replication_host = "127.0.0.1";
|
|
worker_replication_http_port = 9093;
|
|
|
|
worker_listeners = [
|
|
{
|
|
port = 6167;
|
|
tls = false;
|
|
type = "http";
|
|
x_forwarded = true;
|
|
bind_adrresses = [ "0.0.0.0" ];
|
|
resources =
|
|
[
|
|
{
|
|
names = listener_resources;
|
|
compress = false;
|
|
}
|
|
];
|
|
}
|
|
];
|
|
|
|
worker_log_config = logConfig pkgs;
|
|
};
|
|
arguments = {
|
|
config-path = [
|
|
(commonConfig pkgs)
|
|
"/secrets/extra.yaml"
|
|
"/var/lib/registrations/extra.yaml"
|
|
];
|
|
keys-directory = [
|
|
"/var/lib/synapse/keys"
|
|
];
|
|
};
|
|
};
|
|
});
|
|
}
|