nixos-config/config/services/mautrix-telegram.nix

72 lines
2 KiB
Nix
Raw Normal View History

2023-04-18 18:46:46 +00:00
{config, ...}: {
2022-11-23 17:07:49 +00:00
imports = [
../../modules/matrix/mautrix-telegram.nix
];
services.mautrix-telegram-2 = {
2022-04-30 19:57:51 +00:00
enable = true;
environmentFile = config.sops.secrets."services/mautrix/telegram".path;
settings = {
homeserver = {
2023-04-18 18:28:10 +00:00
address = "https://matrix.chir.rs";
2022-04-30 19:57:51 +00:00
domain = "chir.rs";
http_retry_count = 1000;
async_media = true;
2022-04-30 19:57:51 +00:00
};
appservice = {
2022-04-30 20:38:37 +00:00
address = "http://localhost:29317";
2023-04-18 19:58:57 +00:00
hostname = "0.0.0.0";
2022-04-30 19:57:51 +00:00
port = 29317;
max_body_size = 10;
database = "postgres:///mautrix_telegram?sslmode=disable&host=/run/postgresql";
2022-04-30 21:18:44 +00:00
as_token = "$AS_TOKEN";
hs_token = "$HS_TOKEN";
2022-04-30 19:57:51 +00:00
};
bridge = {
displayname_template = "{displayname}";
2022-05-01 07:35:58 +00:00
max_initial_member_sync = -1;
2022-11-24 09:21:48 +00:00
sync_channel_members = true;
startup_sync = true;
sync_create_limit = 0;
2022-11-24 09:21:48 +00:00
sync_deferred_create_all = true;
public_portals = true;
2022-11-24 09:21:48 +00:00
sync_with_custom_puppets = true;
sync_direct_chat_list = true;
invite_link_resolve = true;
2022-05-01 07:35:58 +00:00
encryption = {
allow = true;
2024-05-17 07:05:12 +00:00
default = true;
2023-10-01 14:47:26 +00:00
appservice = false;
2024-03-13 19:47:47 +00:00
require = false;
allow_key_sharing = true;
2022-05-01 07:35:58 +00:00
};
private_chat_portal_meta = "aways";
delivery_receipts = true;
2023-05-28 19:27:47 +00:00
pinned_tag = "m.favourite";
archive_tag = "m.lowpriority";
2022-11-24 09:21:48 +00:00
backfill = {
2023-10-01 14:47:26 +00:00
enable = true;
normal_groups = true;
2022-11-24 09:21:48 +00:00
unread_hours_threshold = -1;
};
2022-04-30 19:57:51 +00:00
permissions = {
2023-03-20 13:58:46 +00:00
"*" = "relaybot";
2024-05-17 07:05:12 +00:00
"@miifox:chir.rs" = "full";
2022-04-30 19:57:51 +00:00
"@lotte:chir.rs" = "admin";
};
};
telegram = {
api_id = "$API_ID";
api_hash = "$API_HASH";
2023-03-20 12:11:23 +00:00
bot_token = "$BOT_TOKEN";
2022-04-30 19:57:51 +00:00
connection.retries = -1;
};
};
};
2022-04-30 20:05:59 +00:00
sops.secrets."services/mautrix/telegram".owner = "mautrix-telegram";
2022-04-30 19:57:51 +00:00
services.postgresql.ensureDatabases = [
"mautrix_telegram"
];
}