From 6619a5eac7a990933ad66770c5eafde39e713f4e Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L de Mello" Date: Sat, 21 Feb 2026 13:51:47 -0300 Subject: [PATCH] feat(capytal,chat): whatsapp bridge for the matrix server --- capytal/chat.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) 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 ---------------------------------------------------