Make send-to-telegram a proper script

This commit is contained in:
Andreas Zweili 2024-04-17 22:18:46 +02:00
parent 9ff6dd0500
commit 4a8160ef08
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@
let
cfg = config.services.az-telegram-notifications;
send-to-telegram = pkgs.writeShellScript "send-to-telegram" ''
send-to-telegram = pkgs.writeShellScriptBin "send-to-telegram" ''
export $(${pkgs.gnugrep}/bin/grep -v '^#' ${config.age.secrets.telegramNotifyEnv.path} | ${pkgs.findutils}/bin/xargs)
URL="https://api.telegram.org/bot$TELEGRAM_KEY/sendMessage"
${pkgs.curl}/bin/curl -s -d "chat_id=$CHAT_ID&disable_web_page_preview=1&text=$1" $URL > /dev/null'';