diff --git a/capytal/chat.nix b/capytal/chat.nix index 4ec7884..2f62e4b 100644 --- a/capytal/chat.nix +++ b/capytal/chat.nix @@ -68,6 +68,43 @@ }; }; + services.mautrix-whatsapp = let + # cfg = config.services.mautrix-whatsapp; + continuwuity = config.services.matrix-continuwuity.settings.global; + in { + enable = true; + settings = { + homeserver = { + address = "http://localhost:${toString + (builtins.elemAt continuwuity.port 0)}"; + domain = continuwuity.server_name; + }; + appservice = rec { + address = "http://localhost:${toString port}"; + hostname = "0.0.0.0"; + port = 9403; + + id = "whatsapp"; + bot = { + username = "whatsappbot"; + displayname = "WhatsApp bridge bot"; + }; + }; + bridge = { + permissions = { + "*" = "relay"; + "${continuwuity.server_name}" = "user"; + "${continuwuity.well_known.support_mxid}" = "admin"; + }; + }; + + database = { + type = "sqlite3-fk-wal"; + uri = "file:/var/lib/mautrix-whatsapp/mautrix-whatsapp.db?_txlock=immediate"; + }; + }; + }; + services.caddy.virtualHosts = { ":${toString (config.services.capytalcc.web.port + 1)}".extraConfig = '' # Matrix configuration ---------------------------------------------------