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

64 lines
1.8 KiB
Nix
Raw Normal View History

2022-04-30 19:57:51 +00:00
{ config, pkgs, ... }: {
services.mautrix-telegram = {
enable = true;
environmentFile = config.sops.secrets."services/mautrix/telegram".path;
settings = {
homeserver = {
address = "https://matrix.chir.rs";
domain = "chir.rs";
http_retry_count = 1000;
async_media = true;
};
appservice = {
hostname = "127.0.0.1";
port = 29317;
max_body_size = 10;
database = "postgres:///mautrix_telegram?sslmode=disable&host=/run/postgresql";
as_token = "$AS_TOKEN";
2022-04-30 20:01:19 +00:00
hs_token = "$HS_TOKEN";
2022-04-30 19:57:51 +00:00
};
bridge = {
displayname_template = "{displayname}";
allow_avatar_remove = true;
max_initial_member_sync = -1;
sync_create_limit = 0;
sync_direct_chats = true;
sync_direct_chat_list = true;
double_puppet_server_map = {
chir.rs = "https://matrix.chir.rs";
};
double_puppet_allow_discovery = true;
invite_link_resolve = true;
2022-04-30 20:03:28 +00:00
animated_sticker.target = "webm";
2022-04-30 19:57:51 +00:00
encryption = {
allow = true;
default = true;
keysharing.allow = true;
};
delivery_receipts = true;
delivery_error_reports = true;
pinned_tag = "m.favourite";
archive_tag = "m.lowpriority";
permissions = {
"@lotte:chir.rs" = "admin";
};
};
telegram = {
api_id = "$API_ID";
api_hash = "$API_HASH";
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"
];
services.postgresql.ensureUsers = [{
name = "mautrix-telegram";
ensurePermissions = {
"DATABASE mautrix_telegram" = "ALL PRIVILEGES";
};
}];
}