{ config, pkgs, ... }: { users.users.matrix-synapse.extraGroups = [ "mautrix-whatsapp" ]; services.mautrix-whatsapp = { enable = true; settings = { homeserver.address = "https://matrix.ctu.cx"; homeserver.domain = "ctu.cx"; metrics.enabled = true; whatsapp.os_name = "Mautrix-WhatsApp bridge (ctu.cx)"; appservice = { address = "http://localhost:29318"; hostname = "[::1]"; port = 29318; id = "whatsapp"; database.type = "sqlite3-fk-wal"; database.uri = "file:/var/lib/mautrix-whatsapp/mautrix-whatsapp.db?_txlock=immediate"; }; bridge = { command_prefix = "!wa"; displayname_template = "{{if .BusinessName}}{{.BusinessName}}{{else if .PushName}}{{.PushName}}{{else}}{{.JID}}{{end}} (WA)"; username_template = "whatsapp_{{.}}"; delivery_receipts = true; message_status_events = true; message_error_notices = true; call_start_notices = true; identity_change_notices = true; user_avatar_sync = true; personal_filtering_spaces = true; encryption.allow = true; permissions = { "ctu.cx" = "user"; }; history_sync = { backfill = true; message_count = 250; request_full_sync = true; }; relay = { enabled = true; }; }; }; }; }