2023-06-13 23:05:35 +02:00
|
|
|
{ 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} = {
|
2023-10-07 19:55:39 +02:00
|
|
|
package = import ./synapse-package.nix pkgs;
|
2023-06-13 23:05:35 +02:00
|
|
|
settings = {
|
|
|
|
worker_app = "synapse.app.generic_worker";
|
|
|
|
|
|
|
|
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"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|