54 lines
1.5 KiB
Nix
54 lines
1.5 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.jalr.matrix;
|
|
synapseCfg = config.services.matrix-synapse.settings;
|
|
in
|
|
lib.mkIf cfg.mautrix-whatsapp.enable {
|
|
services.mautrix-whatsapp = {
|
|
enable = true;
|
|
registerToSynapse = true;
|
|
settings = {
|
|
homeserver = {
|
|
address = synapseCfg.public_baseurl;
|
|
domain = synapseCfg.server_name;
|
|
};
|
|
appservice = rec {
|
|
hostname = "127.0.0.1";
|
|
inherit (cfg.mautrix-whatsapp) port;
|
|
address = "http://${hostname}:${toString port}";
|
|
provisioning.shared_secret = "disable";
|
|
database = {
|
|
type = "sqlite3";
|
|
uri = "/var/lib/mautrix-whatsapp/mautrix-whatsapp.db";
|
|
};
|
|
id = "whatsapp";
|
|
bot = {
|
|
username = "whatsappbot";
|
|
displayname = "WhatsApp bridge bot";
|
|
avatar = "mxc://maunium.net/NeXNQarUbrlYBiPCpprYsRqr";
|
|
};
|
|
};
|
|
whatsapp = {
|
|
browser_name = "mx-wa";
|
|
os_name = "Mautrix-WhatsApp bridge";
|
|
};
|
|
bridge = {
|
|
command_prefix = "!wa";
|
|
delivery_receipts = true;
|
|
displayname_template = "{{if .FullName}}{{.FullName}}{{else if .Notify}}{{.Notify}}{{else}}{{.Jid}}{{end}} (WA)";
|
|
history_sync = {
|
|
backfill = true;
|
|
};
|
|
identity_change_notices = true;
|
|
private_chat_portal_meta = true;
|
|
reaction_notices = true;
|
|
relay.enable = false;
|
|
};
|
|
logging = {
|
|
print_level = "info";
|
|
file_name_format = null;
|
|
};
|
|
} // cfg.mautrix-whatsapp.settings;
|
|
};
|
|
}
|