summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/matterbridge.nix
blob: a68aa292ce16b3a1da60582768845b8b1f545dc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ pkgs, lib, ...  }: {
  services.matterbridge = {
    enable = true;
    configPath = let
      bridgeBotToken = lib.strings.fileContents <secrets/telegram.token>;
    in
      toString ((pkgs.formats.toml {}).generate "config.toml" {
        general = {
          RemoteNickFormat = "[{NICK}] ";
          Charset = "utf-8";
        };
        telegram.krebs.Token = bridgeBotToken;
        irc = let
          Nick = "ponte";
        in {
          hackint = {
            Server = "irc.hackint.org:6697";
            UseTLS = true;
            inherit Nick;
          };
        };
        gateway = [
          {
            name = "krebs-bridge";
            enable = true;
            inout = [
              {
                account = "irc.hackint";
                channel = "#krebs";
              }
              {
                account = "telegram.krebs";
                channel = "-330372458";
              }
            ];
          }
        ];
      });
  };
}