2022-06-12 15:39:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
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 = {
|
2022-08-25 18:43:17 +00:00
|
|
|
address = "https://matrix.int.chir.rs";
|
2022-04-30 19:57:51 +00:00
|
|
|
domain = "chir.rs";
|
|
|
|
http_retry_count = 1000;
|
|
|
|
};
|
|
|
|
appservice = {
|
2022-04-30 20:38:37 +00:00
|
|
|
address = "http://localhost:29317";
|
2022-04-30 19:57:51 +00:00
|
|
|
hostname = "127.0.0.1";
|
|
|
|
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}";
|
|
|
|
allow_avatar_remove = true;
|
2022-05-01 07:35:58 +00:00
|
|
|
max_initial_member_sync = -1;
|
|
|
|
sync_create_limit = 0;
|
2022-04-30 19:57:51 +00:00
|
|
|
sync_direct_chats = true;
|
|
|
|
sync_direct_chat_list = true;
|
2022-06-12 15:39:15 +00:00
|
|
|
double_puppet_server_map = {};
|
|
|
|
login_shared_secret_map = {};
|
2022-04-30 19:57:51 +00:00
|
|
|
double_puppet_allow_discovery = true;
|
|
|
|
invite_link_resolve = true;
|
2022-04-30 20:03:28 +00:00
|
|
|
animated_sticker.target = "webm";
|
2022-11-24 09:21:48 +00:00
|
|
|
sync_channel_members = true;
|
|
|
|
startup_sync = true;
|
|
|
|
sync_deferred_create_all = true;
|
|
|
|
sync_with_custom_puppets = true;
|
2022-05-01 07:35:58 +00:00
|
|
|
encryption = {
|
|
|
|
allow = true;
|
2023-03-18 09:18:02 +00:00
|
|
|
default = false;
|
|
|
|
require = false;
|
2022-11-22 10:35:25 +00:00
|
|
|
allow_key_sharing = true;
|
2022-05-01 07:35:58 +00:00
|
|
|
};
|
2023-03-18 09:16:33 +00:00
|
|
|
public_portals = true;
|
2022-11-24 09:21:48 +00:00
|
|
|
private_chat_portal_meta = true;
|
|
|
|
mute_bridging = true;
|
|
|
|
backfill = {
|
|
|
|
msc2716 = true;
|
|
|
|
normal_groups = true;
|
|
|
|
unread_hours_threshold = -1;
|
|
|
|
incremental.max_batches.supergroup = -1;
|
|
|
|
};
|
2022-04-30 19:57:51 +00:00
|
|
|
delivery_receipts = true;
|
|
|
|
delivery_error_reports = true;
|
2023-03-18 09:16:33 +00:00
|
|
|
incoming_bridge_error_reports = true;
|
2022-04-30 19:57:51 +00:00
|
|
|
pinned_tag = "m.favourite";
|
|
|
|
archive_tag = "m.lowpriority";
|
|
|
|
permissions = {
|
2023-03-20 13:58:46 +00:00
|
|
|
"*" = "relaybot";
|
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"
|
|
|
|
];
|
2022-06-12 15:39:15 +00:00
|
|
|
services.postgresql.ensureUsers = [
|
|
|
|
{
|
|
|
|
name = "mautrix-telegram";
|
|
|
|
ensurePermissions = {
|
|
|
|
"DATABASE mautrix_telegram" = "ALL PRIVILEGES";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2022-04-30 19:57:51 +00:00
|
|
|
}
|