stockholm/krebs/5pkgs/simple/irc-announce/default.nix

25 lines
430 B
Nix
Raw Normal View History

{ pkgs, lib, ... }:
2023-07-08 12:50:48 +00:00
pkgs.writers.writeDashBin "irc-announce" ''
set -euf
IRC_SERVER=$1
IRC_PORT=$2
IRC_NICK=$3_$$
IRC_CHANNEL=$4
2021-09-05 20:51:37 +00:00
IRC_TLS=$5
message=$6
2021-10-05 21:09:44 +00:00
if test "$IRC_TLS" != 1; then
unset IRC_TLS
fi
printf %s "$message" |
${pkgs.ircaids}/bin/ircsink \
--nick="$IRC_NICK" \
--port="$IRC_PORT" \
--server="$IRC_SERVER" \
--target="$IRC_CHANNEL" \
''${IRC_TLS:+--secure}
''