Use gateways in mattermost config instead of samechannelgateway

Matrix wants a special format for the channel name, so
samechannelgateway doesn't work.
master
Brian Picciano 1 year ago
parent dd16d1f443
commit 050f3bd7cb
  1. 93
      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;

Loading…
Cancel
Save