From e0576eb972a8ad60bd8f9a4418add448d1e674a5 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 18 Apr 2020 19:17:27 +0200 Subject: l radio: post currently playing song to irc --- lass/2configs/radio.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lass/2configs/radio.nix') diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix index 9da0a499..562dbbe5 100644 --- a/lass/2configs/radio.nix +++ b/lass/2configs/radio.nix @@ -196,6 +196,14 @@ in { done | while read track; do echo "$(date -Is)" "$track" | tee -a "$HISTORY_FILE" echo "$(tail -$LIMIT "$HISTORY_FILE")" > "$HISTORY_FILE" + ${pkgs.curl}/bin/curl -fsSv --unix-socket /home/radio/reaktor.sock http://z/ \ + -H content-type:application/json \ + -d "$(${pkgs.jq}/bin/jq -n \ + --arg track "$track" '{ + command:"PRIVMSG", + params:["#the_playlist","playing: " + $track] + }' + )" done ''; in { @@ -207,6 +215,7 @@ in { serviceConfig = { ExecStart = recentlyPlayed; + User = "radio"; }; }; @@ -219,6 +228,7 @@ in { useTLS = true; nick = "the_playlist"; username = "radio"; + API.listen = "unix:/home/radio/reaktor.sock"; plugins = [ { plugin = "register"; -- cgit v1.2.3