From 050f3bd7cbf039cd2b0fce8d67642be477e87b20 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sun, 12 Feb 2023 23:22:07 +0100 Subject: [PATCH] Use gateways in mattermost config instead of samechannelgateway Matrix wants a special format for the channel name, so samechannelgateway doesn't work. --- nixos_configs/bridge.nix | 93 +++++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 45 deletions(-) diff --git a/nixos_configs/bridge.nix b/nixos_configs/bridge.nix index 22b02f8..03f06b5 100644 --- a/nixos_configs/bridge.nix +++ b/nixos_configs/bridge.nix @@ -38,6 +38,53 @@ in { ]; services.matterbridge = let + + channels = [ + "a-rusty-venture" + "anime" + "bossin_around" + "bot-test" + "bridge-test" + "cryptic-bunker" + "cryptic-chat" + "cryptic-net-public" + "dumbathon" + "europe" + "generic-gaming" + "get-rich-fast" + "gnv" + "golang" + "jerbs" + "main_linux" + "minecraft" + "nyc" + "omg-berks" + "sf" + "smersh" + "to-the-moon-and-back" + "travel" + "tunes" + ]; + + gateways = lib.strings.concatMapStrings (channel: '' + [[gateway]] + name="${channel}-gateway" + enable=true + + [[gateway.inout]] + account="matrix.wafflefarm" + channel="#${channel}:waffle.farm" + + [[gateway.inout]] + account="slack.cryptic" + channel="${channel}" + + [[gateway.inout]] + account="discord.cryptic" + channel="${channel}" + + '') channels; + config-file = pkgs.writeText "matterbridge.toml" '' [discord.cryptic] Token="${secrets.matterbridge.discord2.token}" @@ -60,51 +107,7 @@ SpoofUsername=true PreserveThreading=true KeepQuotedReply=false -[[gateway]] -name="testgateway" -enable=true - -[[gateway.inout]] -account="matrix.wafflefarm" -channel="#bridge-test:waffle.farm" - -[[gateway.inout]] -account="slack.cryptic" -channel="bridge-test" - -[[gateway.inout]] -account="discord.cryptic" -channel="bridge-test" - -[[samechannelgateway]] - name="same-channel-gw" - enable = true - accounts = [ "slack.cryptic", "discord.cryptic" ] - channels = [ - "a-rusty-venture", - "anime", - "bossin_around", - "bot-test", - "cryptic-bunker", - "cryptic-chat", - "cryptic-net-public", - "dumbathon", - "europe", - "generic-gaming", - "get-rich-fast", - "gnv", - "golang", - "jerbs", - "main_linux", - "minecraft", - "nyc", - "omg-berks", - "sf", - "smersh", - "to-the-moon-and-back", - "travel", - "tunes" - ] +${gateways} ''; in { enable = true;