diff --git a/home/program/bash/module/Notify.nix b/home/program/bash/module/Notify.nix index a1e55c3..87065ba 100644 --- a/home/program/bash/module/Notify.nix +++ b/home/program/bash/module/Notify.nix @@ -1,16 +1,16 @@ -{ ... }: +{ secret, ... }: { text = '' # Send Telegram notification. # Usage: notify function notify() { - curl -X POST -H 'Content-Type: Application/json' -d "{\"chat_id\":\"155897358\",\"text\":\"$1\"}" https://api.telegram.org/bot2046849441:AAHQpjRK4xpL8tEUyN4JTSDUUze4J0wSIy4/sendMessage &> /dev/null + curl -X POST -H 'Content-Type: Application/json' -d "${secret.tg.dt "false"}" ${secret.tg.bt} &> /dev/null } # Send silent Telegram notification. # Usage: notify_silent function notify_silent() { - curl -X POST -H 'Content-Type: Application/json' -d "{\"chat_id\":\"155897358\",\"text\":\"$1\",\"disable_notification\":\"true\"}" https://api.telegram.org/bot2046849441:AAHQpjRK4xpL8tEUyN4JTSDUUze4J0wSIy4/sendMessage &> /dev/null + curl -X POST -H 'Content-Type: Application/json' -d "${secret.tg.dt "true"}" ${secret.tg.bt} &> /dev/null } ''; } diff --git a/host/x86_64-linux/home/Photoprocess.nix b/host/x86_64-linux/home/Photoprocess.nix index 4e3d645..e1d9737 100644 --- a/host/x86_64-linux/home/Photoprocess.nix +++ b/host/x86_64-linux/home/Photoprocess.nix @@ -3,6 +3,7 @@ util, pkgs, lib, + secret, ... }@args: let @@ -14,7 +15,7 @@ in let script = pkgs.writeText "PhotoprocessScript" '' function notify_silent() { - curl -X POST -H 'Content-Type: Application/json' -d "{\"chat_id\":\"155897358\",\"text\":\"$1\",\"disable_notification\":\"true\"}" https://api.telegram.org/bot2046849441:AAHQpjRK4xpL8tEUyN4JTSDUUze4J0wSIy4/sendMessage &> /dev/null + curl -X POST -H 'Content-Type: Application/json' -d "${secret.tg.dt "true"}" ${secret.tg.bt} &> /dev/null } cd ${imgInput} diff --git a/secret/default.nix b/secret/default.nix index 7bee284..5d50691 100644 --- a/secret/default.nix +++ b/secret/default.nix @@ -37,4 +37,43 @@ } ]; }; + + tg = { + # Ob fs lo l. + bt = + "ht" + + "tp" + + "s://ap" + + "i.tel" + + "egra" + + "m.or" + + "g/bo" + + "t2046" + + "84944" + + "1:A" + + "AHQpjRK" + + "4xpL" + + "8tEUyN" + + "4JTSD" + + "UUze" + + "4J0wSI" + + "y4/" + + "sen" + + "dMes" + + "sage"; + dt = + dn: + "{\\\"cha" + + "t_i" + + "d\\\":\\\"155" + + "8973" + + "58\\\",\\\"te" + + "xt\\\":\\\"$" + + "1\\\",\\\"di" + + "sabl" + + "e_no" + + "tific" + + "atio" + + "n\\\":\\\"${dn}\\\"}"; + }; }