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

75 lines
2 KiB
Nix
Raw Normal View History

2022-07-22 11:54:03 +01:00
{pkgs, ...}: {
imports = [
../../modules/matrix/mautrix-discord.nix
];
services.mautrix-discord = {
enable = true;
environmentFile = pkgs.emptyFile;
settings = {
homeserver = {
2023-04-18 19:28:10 +01:00
address = "https://matrix.chir.rs";
2022-07-22 11:54:03 +01:00
domain = "chir.rs";
async_media = true;
2022-07-22 11:54:03 +01:00
};
appservice = {
database = {
type = "postgres";
uri = "postgres:///mautrix_discord?sslmode=disable&host=/run/postgresql";
};
2023-10-01 15:47:26 +01:00
ephemeral_events = true;
2023-04-19 21:09:26 +01:00
async_transactions = true;
2022-07-22 11:54:03 +01:00
};
metrics = {
enabled = true;
2022-07-22 17:30:08 +01:00
listen = "[::]:29321";
2022-07-22 11:54:03 +01:00
};
bridge = {
channel_name_template = "{{if or (eq .Type 3) (eq .Type 4)}}{{.Name}} ({{.GuildName}} {{.ParentName}}){{else}}#{{.Name}} ({{.GuildName}} {{.ParentName}}){{end}}";
private_chat_portal_meta = "always";
2023-04-19 21:09:26 +01:00
startup_private_channel_create_limit = 25;
2022-07-22 11:54:03 +01:00
delivery_receipts = true;
2022-11-24 10:21:48 +01:00
sync_direct_chat_list = true;
2023-05-28 20:27:47 +01:00
delete_portal_on_channel_delete = true;
prefix_webhook_messages = true;
cache_media = "always";
2023-06-08 08:00:58 +01:00
animated_sticker.target = "disable";
2023-04-19 21:09:26 +01:00
backfill = {
2023-04-21 07:19:40 +01:00
forward_limits = {
initial.dm = 50;
initial.channel = 50;
2023-10-01 15:47:26 +01:00
initial.thread = 50;
2023-04-19 21:09:26 +01:00
2023-04-21 07:19:40 +01:00
missed.dm = -1;
missed.channel = -1;
2023-10-01 15:47:26 +01:00
missed.thread = -1;
2023-04-21 07:19:40 +01:00
};
2023-04-19 21:09:26 +01:00
};
encryption = {
2023-05-28 20:27:47 +01:00
allow = true;
2023-10-01 15:47:26 +01:00
default = true;
appservice = false;
require = true;
plaintext_mentions = true;
2023-05-28 20:27:47 +01:00
allow_key_sharing = true;
};
permissions = {
"*" = "relay";
"@lotte:chir.rs" = "admin";
};
2022-07-22 11:54:03 +01:00
};
};
};
services.postgresql.ensureDatabases = [
"mautrix_discord"
];
services.postgresql.ensureUsers = [
{
name = "mautrix-discord";
ensurePermissions = {
"DATABASE mautrix_discord" = "ALL PRIVILEGES";
};
}
];
}