feat: add mautrix-discord bridge for Matrix #865
No files matched your search
@@ -67,6 +67,7 @@
|
||||
enable = true;
|
||||
tokenSecret = ../../modules/services/gitea/actions/boron.age;
|
||||
};
|
||||
matrix.mautrix_discord = true;
|
||||
zookeeper.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -34,6 +34,7 @@ in
|
||||
jellyfin = "phoenix.st.${config.ogygia.domain}";
|
||||
mastodon = "";
|
||||
matrix = "boron.cx.${config.ogygia.domain}";
|
||||
mautrix_discord = "warlock.cx.${config.ogygia.domain}";
|
||||
mosquitto = "stinger.pop.${config.ogygia.domain}";
|
||||
nix-builder = [
|
||||
"slider.pop.${config.ogygia.domain}"
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
./jellyfin.nix
|
||||
./mastodon
|
||||
./matrix
|
||||
./mautrix-discord
|
||||
./mosquitto.nix
|
||||
./nix-builder
|
||||
./nix-prefetch-repos.nix
|
||||
|
||||
@@ -16,6 +16,12 @@ in
|
||||
default = true;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
|
||||
mautrix_discord = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
description = "Load mautrix-discord bridge registration";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
@@ -47,6 +53,12 @@ in
|
||||
"matrix/matrix.hillion.co.uk/syncv3_secret" = {
|
||||
file = ./matrix.hillion.co.uk/syncv3_secret.age;
|
||||
};
|
||||
|
||||
"mautrix-discord/registration.yaml" = lib.mkIf cfg.mautrix_discord {
|
||||
file = ../mautrix-discord/registration.yaml.age;
|
||||
owner = "matrix-synapse";
|
||||
group = "matrix-synapse";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
@@ -133,9 +145,9 @@ in
|
||||
];
|
||||
suppress_key_server_warning = true;
|
||||
dynamic_thumbnails = true;
|
||||
app_service_config_files = lib.mkIf cfg.heisenbridge [
|
||||
"/var/lib/heisenbridge/registration.yml"
|
||||
];
|
||||
app_service_config_files =
|
||||
(lib.optional cfg.heisenbridge "/var/lib/heisenbridge/registration.yml") ++
|
||||
(lib.optional cfg.mautrix_discord config.age.secrets."mautrix-discord/registration.yaml".path);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.custom.services.mautrix_discord;
|
||||
in
|
||||
{
|
||||
options.custom.services.mautrix_discord = {
|
||||
enable = lib.mkEnableOption "mautrix-discord bridge";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"olm-3.2.16"
|
||||
];
|
||||
|
||||
services.mautrix-discord.dataDir = lib.mkIf config.custom.impermanence.enable
|
||||
"${config.custom.impermanence.base}/services/mautrix-discord";
|
||||
|
||||
age.secrets = {
|
||||
"mautrix-discord/registration.yaml" = {
|
||||
file = ./registration.yaml.age;
|
||||
owner = "mautrix-discord";
|
||||
group = "mautrix-discord";
|
||||
};
|
||||
"mautrix-discord/environment" = {
|
||||
file = ./environment.age;
|
||||
owner = "mautrix-discord";
|
||||
group = "mautrix-discord";
|
||||
};
|
||||
"backups/mautrix-discord/restic/mig29" = {
|
||||
file = ../../../secrets/restic/mig29.age;
|
||||
};
|
||||
};
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = [ "mautrix-discord" ];
|
||||
ensureUsers = [{
|
||||
name = "mautrix-discord";
|
||||
ensureDBOwnership = true;
|
||||
}];
|
||||
};
|
||||
|
||||
services.postgresqlBackup = {
|
||||
enable = true;
|
||||
compression = "none";
|
||||
databases = [ "mautrix-discord" ];
|
||||
};
|
||||
|
||||
services.restic.backups."mautrix-discord" = {
|
||||
user = "root";
|
||||
timerConfig = {
|
||||
OnCalendar = "03:30";
|
||||
RandomizedDelaySec = "60m";
|
||||
};
|
||||
repository = "rest:https://restic.${config.ogygia.domain}/mig29";
|
||||
passwordFile = config.age.secrets."backups/mautrix-discord/restic/mig29".path;
|
||||
paths = [
|
||||
"${config.services.postgresqlBackup.location}/mautrix-discord.sql"
|
||||
config.services.mautrix-discord.dataDir
|
||||
];
|
||||
};
|
||||
|
||||
services.mautrix-discord = {
|
||||
enable = true;
|
||||
registerToSynapse = false;
|
||||
environmentFile = config.age.secrets."mautrix-discord/environment".path;
|
||||
|
||||
settings = {
|
||||
homeserver = {
|
||||
domain = "hillion.co.uk";
|
||||
address = "http://boron.cx.${config.ogygia.domain}:8008";
|
||||
};
|
||||
appservice = {
|
||||
hostname = "0.0.0.0";
|
||||
port = 29334;
|
||||
address = "http://warlock.cx.${config.ogygia.domain}:29334";
|
||||
database = {
|
||||
type = "postgres";
|
||||
uri = "postgres:///mautrix-discord?host=/run/postgresql";
|
||||
};
|
||||
as_token = "$AS_TOKEN";
|
||||
hs_token = "$HS_TOKEN";
|
||||
bot.username = "discordbot";
|
||||
};
|
||||
bridge.permissions."@jake:hillion.co.uk" = "admin";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.mautrix-discord = {
|
||||
after = [ "postgresql-setup.service" ];
|
||||
requires = [ "postgresql-setup.service" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
+10
@@ -75,6 +75,7 @@ in
|
||||
neb.cx.boron
|
||||
neb.cx.rooster
|
||||
neb.cx.maverick
|
||||
neb.cx.warlock
|
||||
neb.pop.stinger
|
||||
neb.rig.merlin
|
||||
neb.st.phoenix
|
||||
@@ -173,4 +174,13 @@ in
|
||||
|
||||
# Offline YouTube secrets
|
||||
"modules/services/offline-youtube/playlist.env.age".publicKeys = [ neb.st.phoenix ];
|
||||
|
||||
# mautrix-discord bridge
|
||||
"modules/services/mautrix-discord/registration.yaml.age".publicKeys = jake_users ++ [
|
||||
neb.cx.boron # Synapse needs registration
|
||||
neb.cx.warlock # Bridge needs registration
|
||||
];
|
||||
"modules/services/mautrix-discord/environment.age".publicKeys = jake_users ++ [
|
||||
neb.cx.warlock # Bridge needs tokens
|
||||
];
|
||||
}
|
||||
+17
-16
@@ -1,17 +1,18 @@
|
||||
age-encryption.org/v1
|
||||
-> ssh-ed25519 iWiFbA ZwPWGTjircGCE2jAetHmpZm7CAIqnfVrOuUfhtRhw0A
|
||||
uC4PkfbCup0/4j604k8zAcCNgU4HykMHu27Hwl0l3Eg
|
||||
-> ssh-ed25519 2Uo1TA 5CU1v9Rmn2ETyq3bbMrWJYZyhxy6gilCDLu9yY1Ri1A
|
||||
L6qaUGUKkIrrHzdG+SSfJV3kL+6morOcfp40u+wonoo
|
||||
-> ssh-ed25519 Ir5/fg wKVB5S7374giAAwcD8Nq+cxsUB39GtRmOaKpf3Is9A0
|
||||
RUaVkp1jKLeXbaf/dIesCOtwdmA0SwVinI4rQIcrlPw
|
||||
-> ssh-ed25519 IrNzWQ arUHCDGMMythxoBGnaLwWOeWmmqSG/BCRsc483SK/VU
|
||||
oGrfmzhjz29tky+K1vnbmT9L4k+1DiZoN0JmXAJxK7A
|
||||
-> ssh-ed25519 6tJ2Ww jISnwN0PQTi5ZppanFKzvNFZnD4m/Kl2ENKhEK0qdys
|
||||
+RZ7SNheNUHjgjppHzkGy9ozhI1Jwhz870OJh/FwaGY
|
||||
-> ssh-ed25519 RR/L5A NhcLB9R3uvp39ptdMcmt1i4n66+qKPvUU57vNWwFLEU
|
||||
r2QBK5JwJxFOe5MHgzK99rBhlEXRjKB6JYcvHFabkVc
|
||||
--- FbeWXscR/x+y0P6HkAnKpAjT1Lpu/FRWLZziPA6p/oc
|
||||
�ÝÉLjí
|
||||
Ñï|µ0Ÿ–Ú
|
||||
WÂ)õW-2>GàB~j´³šiÖHù#ÛNƒ–?ó£Òã$ÓW
|
||||
-> ssh-ed25519 iWiFbA 7Xmx8NaFllKUX36gJWRhpf7Ek/wokCAT4WuCpoez3Hc
|
||||
EsppPEbmUususjIaHdijRkpohGWad+2moW20WuIx8Yw
|
||||
-> ssh-ed25519 2Uo1TA 6KiWbJx0VKqMcSIkmvpEXiQPVh5vTSO6TEvg1RlfNRg
|
||||
lGArrLdLCbR9BJdRVPelMqRevhq7A7zXa40b8ymunPs
|
||||
-> ssh-ed25519 Ir5/fg eGTtDlbzks562t1RjXX35Vnm5MMBCiHfzGxGlXDBpHw
|
||||
omZLdA/Z3gAzuydD8dCIQnLbSu1Ene+pcQNUJcj1Fzk
|
||||
-> ssh-ed25519 matmAg PeQlZnb8x0Yow/zZmic6Wq3eiGmWQVf921wkbKh2Fy8
|
||||
lqfwOBl37gZwP4NREHeCfIt0A/Pxe6M4gccPw4w6ZNM
|
||||
-> ssh-ed25519 IrNzWQ Zu2pETWJzOBUYlFfcMYhNz7kaY+cBaSSGvoX/umXBmU
|
||||
MNRmvlbsQ6q/Oe85pqSUYXAWFwU49BJSeGCNLP7C2UM
|
||||
-> ssh-ed25519 6tJ2Ww rx5dsFOGaH/Fc9D+aAS1Q87dQQyVi0Svj01dosQ0jxU
|
||||
giEBC0Wr/fC2KSc+u2GZy90my//8QJ/hvw9vgKfchfA
|
||||
-> ssh-ed25519 RR/L5A FgK88d1rhjJczbtq4wFbQMsKPRLv95yI+3t8VeETgSk
|
||||
u1Py2rrX1QALyUb9mgJSJLI9yC6ddrfUVLxF2K6Yc70
|
||||
--- UWlJTr6Vdw0i1vTxRNRWdmF5p13oy5UvUDj0+VNmbSA
|
||||
¢5ŽEñR•¼Ø«í(z¨þ”<DÆ[zÂc¬
|
||||
I¦£9{Ñ„…È>"/ûîâGâAlƒ0'“äµ
|
||||
Reference in new issue
Block a user