2022-06-12 15:39:15 +00:00
|
|
|
{pkgs, ...}: {
|
2022-05-03 19:25:44 +00:00
|
|
|
imports = [
|
|
|
|
../../modules/matrix/mautrix-whatsapp.nix
|
|
|
|
];
|
|
|
|
|
|
|
|
services.mautrix-whatsapp = {
|
|
|
|
enable = true;
|
|
|
|
environmentFile = pkgs.emptyFile;
|
|
|
|
settings = {
|
|
|
|
homeserver = {
|
2023-04-18 18:28:10 +00:00
|
|
|
address = "https://matrix.chir.rs";
|
2022-05-03 19:25:44 +00:00
|
|
|
domain = "chir.rs";
|
2023-09-08 11:41:22 +00:00
|
|
|
async_media = true;
|
2022-05-03 19:25:44 +00:00
|
|
|
};
|
|
|
|
appservice = {
|
|
|
|
database = {
|
|
|
|
type = "postgres";
|
|
|
|
uri = "postgres:///mautrix_whatsapp?sslmode=disable&host=/run/postgresql";
|
|
|
|
};
|
2023-04-19 20:09:26 +00:00
|
|
|
async_transactions = true;
|
2022-05-03 19:25:44 +00:00
|
|
|
};
|
|
|
|
metrics = {
|
|
|
|
enabled = true;
|
|
|
|
listen = "[::]:29319";
|
|
|
|
};
|
|
|
|
bridge = {
|
2022-06-04 16:03:06 +00:00
|
|
|
displayname_template = "{{if .PushName}}{{.PushName}}{{else if .BusinessName}}{{.BusinessName}}{{else}}{{.JID}}{{end}}";
|
2022-05-03 19:25:44 +00:00
|
|
|
personal_filtering_spaces = true;
|
|
|
|
delivery_receipts = true;
|
2023-05-28 12:31:17 +00:00
|
|
|
message_error_notices = true;
|
2022-11-24 09:21:48 +00:00
|
|
|
identity_change_notices = true;
|
2022-05-03 19:25:44 +00:00
|
|
|
hystory_sync = {
|
|
|
|
backfill = true;
|
|
|
|
request_full_sync = true;
|
|
|
|
};
|
2023-05-28 12:31:17 +00:00
|
|
|
user_avatar_sync = true;
|
|
|
|
sync_with_custom_puppets = true;
|
|
|
|
sync_direct_chat_list = true;
|
|
|
|
sync_manual_marked_unread = true;
|
|
|
|
private_chat_portal_meta = "always";
|
|
|
|
parallel_member_sync = true;
|
2022-05-03 19:25:44 +00:00
|
|
|
pinned_tag = "m.favourite";
|
|
|
|
archive_tag = "m.lowpriority";
|
|
|
|
allow_user_invite = true;
|
|
|
|
url_previews = true;
|
2023-05-28 12:31:17 +00:00
|
|
|
extev_polls = true;
|
|
|
|
cross_room_replies = true;
|
2022-05-03 19:25:44 +00:00
|
|
|
encryption = {
|
|
|
|
allow = true;
|
2023-10-01 14:47:26 +00:00
|
|
|
default = true;
|
|
|
|
appservice = false;
|
|
|
|
require = true;
|
2022-11-22 10:35:25 +00:00
|
|
|
allow_key_sharing = true;
|
2022-05-03 19:25:44 +00:00
|
|
|
};
|
|
|
|
permissions = {
|
2023-03-21 19:33:25 +00:00
|
|
|
"*" = "relay";
|
2022-05-03 19:25:44 +00:00
|
|
|
"@lotte:chir.rs" = "admin";
|
|
|
|
};
|
2023-03-21 19:33:25 +00:00
|
|
|
relay.enabled = true;
|
2022-05-03 19:25:44 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
services.postgresql.ensureDatabases = [
|
|
|
|
"mautrix_whatsapp"
|
|
|
|
];
|
2022-06-12 15:39:15 +00:00
|
|
|
services.postgresql.ensureUsers = [
|
|
|
|
{
|
|
|
|
name = "mautrix-whatsapp";
|
|
|
|
ensurePermissions = {
|
|
|
|
"DATABASE mautrix_whatsapp" = "ALL PRIVILEGES";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2022-05-03 19:25:44 +00:00
|
|
|
}
|