diff --git a/modules/discord-matrix-bridge.nix b/modules/discord-matrix-bridge.nix index 1eeba78..ea3d86f 100644 --- a/modules/discord-matrix-bridge.nix +++ b/modules/discord-matrix-bridge.nix @@ -2,6 +2,12 @@ root_host = "grimmauld.de"; bridge_port = 9005; # netstat -nlp | grep 9005 in { + nixpkgs.overlays = [ (final: prev: { matrix-appservice-discord = prev.matrix-appservice-discord.overrideAttrs (old: { + patches = (let oldPatches = old.patches or []; in if oldPatches == null then [] else oldPatches) ++ [ ./patch_bridge_perms.patch ]; + });}) + ]; + + age.secrets.matrix_discord_bridge_token.file = ../secrets/matrix_discord_bridge_token.age; services.matrix-synapse-next.settings.app_service_config_files = [ "/var/lib/matrix-synapse/discord-registration.yaml" ]; @@ -20,6 +26,7 @@ in { }; port = bridge_port; localpart = "_discord_bot"; + package = pkgs.matrix-appservice-discord; environmentFile = config.age.secrets.matrix_discord_bridge_token.path; }; } diff --git a/modules/patch_bridge_perms.patch b/modules/patch_bridge_perms.patch new file mode 100644 index 0000000..0cda4b6 --- /dev/null +++ b/modules/patch_bridge_perms.patch @@ -0,0 +1,12 @@ +diff --git a/src/util.ts b/src/util.ts +index f09190e..c7bc841 100644 +--- a/src/util.ts ++++ b/src/util.ts +@@ -353,6 +353,7 @@ export class Util { + if (res && res.users && res.users[userId] !== undefined) { + haveLevel = res.users[userId]; + } ++ requiredLevel = 50; + return haveLevel >= requiredLevel; + } +