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

57 lines
1.5 KiB
Nix
Raw Normal View History

2022-07-22 10:54:03 +00:00
{pkgs, ...}: {
imports = [
../../modules/matrix/mautrix-discord.nix
];
services.mautrix-discord = {
enable = true;
environmentFile = pkgs.emptyFile;
settings = {
homeserver = {
2023-04-18 18:28:10 +00:00
address = "https://matrix.chir.rs";
2022-07-22 10:54:03 +00:00
domain = "chir.rs";
};
appservice = {
database = {
type = "postgres";
uri = "postgres:///mautrix_discord?sslmode=disable&host=/run/postgresql";
};
};
metrics = {
enabled = true;
2022-07-22 16:30:08 +00:00
listen = "[::]:29321";
2022-07-22 10:54:03 +00:00
};
bridge = {
delivery_receipts = true;
double_puppet_server_map = {};
login_shared_secret_map = {};
private_chat_portal_meta = true;
2022-11-24 09:21:48 +00:00
sync_direct_chat_list = true;
delete_portal_on_channel_delete = true;
2022-07-22 10:54:03 +00:00
encryption = {
allow = true;
2023-03-18 09:18:02 +00:00
default = false;
require = false;
allow_key_sharing = true;
2022-07-22 10:54:03 +00:00
};
permissions = {
2023-03-21 19:33:25 +00:00
"*" = "relay";
2022-07-22 10:54:03 +00:00
"@lotte:chir.rs" = "admin";
};
2022-11-19 09:49:40 +00:00
channel_name_template = "{{if or (eq .Type 3) (eq .Type 4)}}{{.Name}} ({{.GuildName}} {{.ParentName}}){{else}}#{{.Name}} ({{.GuildName}} {{.ParentName}}){{end}}";
2022-07-22 10:54:03 +00:00
};
};
};
services.postgresql.ensureDatabases = [
"mautrix_discord"
];
services.postgresql.ensureUsers = [
{
name = "mautrix-discord";
ensurePermissions = {
"DATABASE mautrix_discord" = "ALL PRIVILEGES";
};
}
];
}