From 2e5167de1560ad0d7b8e294c72e1913f694160c2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 7 Sep 2023 12:26:31 +0200 Subject: lass: migrate away --- lass/2configs/bgt-bot/bgt-check.sh | 57 -------------------------------------- lass/2configs/bgt-bot/default.nix | 44 ----------------------------- 2 files changed, 101 deletions(-) delete mode 100644 lass/2configs/bgt-bot/bgt-check.sh delete mode 100644 lass/2configs/bgt-bot/default.nix (limited to 'lass/2configs/bgt-bot') diff --git a/lass/2configs/bgt-bot/bgt-check.sh b/lass/2configs/bgt-bot/bgt-check.sh deleted file mode 100644 index 30185ba1..00000000 --- a/lass/2configs/bgt-bot/bgt-check.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# needs in path: -# curl gnugrep jq -# creates and manages $PWD/state -set -xeuf - -send_reaktor(){ - # usage: send_reaktor "text" - echo "send_reaktor: $1" - curl -fsS "http://localhost:$REAKTOR_PORT" \ - -H content-type:application/json \ - -d "$(jq -n \ - --arg text "$1" \ - --arg channel "$IRC_CHANNEL" \ - '{ - command:"PRIVMSG", - params:[$channel,$text] - }' - )" -} - -live=$(shuf -n1 < state -fi diff --git a/lass/2configs/bgt-bot/default.nix b/lass/2configs/bgt-bot/default.nix deleted file mode 100644 index 6f9e3370..00000000 --- a/lass/2configs/bgt-bot/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ 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; - }; - }; -} - -- cgit v1.2.3