2024-02-11 18:54:01 +01:00
|
|
|
{ config, lib, pkgs, ...}: let
|
2024-01-26 13:45:18 +01:00
|
|
|
bridge_port = 9005; # netstat -nlp | grep 9005
|
|
|
|
in {
|
2024-01-26 17:05:16 +01:00
|
|
|
nixpkgs.overlays = [ (final: prev: { matrix-appservice-discord = prev.matrix-appservice-discord.overrideAttrs (old: {
|
2024-02-11 18:54:01 +01:00
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "t2bot";
|
|
|
|
repo = "matrix-appservice-discord";
|
|
|
|
rev = "8361ca6121bf1f0902154baa538cb6d5766e477f";
|
|
|
|
hash = "sha256-oXon6pFJgqQ1uBLtsSVNH7XSOpxxJYqpW2n9cFrs3sU=";
|
|
|
|
};
|
2024-01-26 17:05:16 +01:00
|
|
|
patches = (let oldPatches = old.patches or []; in if oldPatches == null then [] else oldPatches) ++ [ ./patch_bridge_perms.patch ];
|
2024-02-11 18:54:01 +01:00
|
|
|
doCheck = false;
|
2024-01-26 17:05:16 +01:00
|
|
|
});})
|
|
|
|
];
|
|
|
|
|
|
|
|
|
2024-01-26 13:50:59 +01:00
|
|
|
age.secrets.matrix_discord_bridge_token.file = ../secrets/matrix_discord_bridge_token.age;
|
2024-01-26 13:45:18 +01:00
|
|
|
|
|
|
|
services.matrix-synapse-next.settings.app_service_config_files = [ "/var/lib/matrix-synapse/discord-registration.yaml" ];
|
|
|
|
|
|
|
|
services.matrix-appservice-discord = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
auth = {
|
|
|
|
usePrivilegedIntents = true; # typing status and stuff
|
|
|
|
};
|
|
|
|
bridge = {
|
|
|
|
enableSelfServiceBridging = true;
|
2024-05-08 20:45:41 +02:00
|
|
|
inherit (config.networking) domain;
|
|
|
|
homeserverUrl = "https://${config.networking.domain}";
|
2024-02-03 11:51:15 +01:00
|
|
|
disablePresence = true;
|
|
|
|
disableTypingNotifications = true;
|
2024-01-26 13:45:18 +01:00
|
|
|
};
|
2024-02-11 18:54:01 +01:00
|
|
|
# logging.console = "silly";
|
2024-01-26 13:45:18 +01:00
|
|
|
};
|
2024-02-03 11:51:15 +01:00
|
|
|
serviceDependencies = ["matrix-synapse.target"];
|
2024-01-26 13:45:18 +01:00
|
|
|
port = bridge_port;
|
2024-02-03 11:51:15 +01:00
|
|
|
localpart = "_discord_";
|
2024-01-26 17:05:16 +01:00
|
|
|
package = pkgs.matrix-appservice-discord;
|
2024-01-26 13:45:18 +01:00
|
|
|
environmentFile = config.age.secrets.matrix_discord_bridge_token.path;
|
|
|
|
};
|
|
|
|
}
|
2024-02-03 11:51:15 +01:00
|
|
|
|