summaryrefslogtreecommitdiffstats
path: root/lass/2configs/bgt-bot/default.nix
blob: 6f9e33704bdc55331ee964b9075130cfc672d6c7 (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
41
42
43
44
{ config, lib, pkgs, ... }:
let

  bot_port = "7654";
  irc_channel = "#binaergewitter";
in
{
  krebs.reaktor2.bgt-announce = {
    hostname = "irc.libera.chat";
    port = "6697";
    nick = "bgt-announce";
    API.listen = "inet://127.0.0.1:${bot_port}";
    plugins = [
      {
        plugin = "register";
        config = {
          channels = [
            irc_channel
          ];
        };
      }
    ];
  };
  systemd.services.check_bgt_show = {
    startAt = "*:0/5";
    environment = {
      IRC_CHANNEL = irc_channel;
      REAKTOR_PORT = bot_port;
    };
    path = with pkgs; [
      curl
      gnugrep
      jq
    ];
    script = builtins.readFile ./bgt-check.sh;
    serviceConfig = {
      DynamicUser = true;
      StateDirectory = "bgt-announce";
      WorkingDirectory = "/var/lib/bgt-announce";
      PrivateTmp = true;
    };
  };
}