{...}: { config.flake.overlayPkgs.azos-homey-ntfy-alert = pkgs: pkgs.writeShellApplication { name = "azos-homey-ntfy-alert"; runtimeInputs = with pkgs; [curl pass]; text = '' TOKEN="$(pass zakobar-homecenter/ntfy-token)" CMD=( curl -sf -H "Authorization: Bearer $TOKEN" -H "Priority: ''${PRIORITY:-default}" ) [[ -n "''${TITLE:-}" ]] && CMD+=(-H "Title: $TITLE") [[ -n "''${TAGS:-}" ]] && CMD+=(-H "Tags: $TAGS") CMD+=(-d "''${MESSAGE:-}" https://ntfy.zakobar.com/alerts) if [[ -n "''${AZOS_SEND_ALERT_PRINT_REMOTE:-}" ]]; then # Shell-quote each element so the output is safe to embed in SSH commands -- # the token is already resolved above, so the remote host only needs curl. printf '%q ' "''${CMD[@]}" printf '\n' else "''${CMD[@]}" fi ''; }; }