{ config, pkgs, lib, ... }: let cfg = config.services.matrix-synapse; in { services.matrix-synapse = lib.mkIf cfg.enableAppserviceWorker { settings = { instance_map = { appservice = { path = "/run/synapse/appservice.sock"; }; }; notify_appservices_from_worker = "appservice"; }; workers = { appservice = { worker_app = "synapse.app.generic_worker"; worker_listeners = [ ]; }; }; }; }