From c3f79aa804421d71f9a48296b3dea0cea2af0368 Mon Sep 17 00:00:00 2001 From: tdback Date: Thu, 26 Dec 2024 20:24:42 -0500 Subject: chore: fix formatting --- modules/scripts/pushover/default.nix | 61 ++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 31 deletions(-) (limited to 'modules/scripts/pushover/default.nix') diff --git a/modules/scripts/pushover/default.nix b/modules/scripts/pushover/default.nix index f20a5be..cedfb20 100644 --- a/modules/scripts/pushover/default.nix +++ b/modules/scripts/pushover/default.nix @@ -1,41 +1,40 @@ { inputs, config, pkgs, ... }: let - pushover = - pkgs.writeShellScriptBin "pushover" '' - #!/bin/sh + pushover = pkgs.writeShellScriptBin "pushover" '' + #!/bin/sh - die() { echo "$0: $*" >&2; exit 111; } + die() { echo "$0: $*" >&2; exit 111; } - APP=$(cat ${config.age.secrets.pushoverAppToken.path}) - USER=$(cat ${config.age.secrets.pushoverUserToken.path}) + APP=$(cat ${config.age.secrets.pushoverAppToken.path}) + USER=$(cat ${config.age.secrets.pushoverUserToken.path}) - while getopts ":t:" args; do - case "$args" in - t) - TITLE="$OPTARG" - ;; - :) - die "missing option argument for -$OPTARG" - ;; - *) - die "invalid option -$OPTARG" - ;; - esac - done - shift $((OPTIND - 1)) + while getopts ":t:" args; do + case "$args" in + t) + TITLE="$OPTARG" + ;; + :) + die "missing option argument for -$OPTARG" + ;; + *) + die "invalid option -$OPTARG" + ;; + esac + done + shift $((OPTIND - 1)) - MESSAGE="$*" - if [ -z "$MESSAGE" ] || [ "$MESSAGE" = " " ]; then - MESSAGE="No errors to report." - fi + MESSAGE="$*" + if [ -z "$MESSAGE" ] || [ "$MESSAGE" = " " ]; then + MESSAGE="No errors to report." + fi - /run/current-system/sw/bin/curl -s \ - --form-string "token=$APP" \ - --form-string "user=$USER" \ - --form-string "title=$TITLE" \ - --form-string "message=$MESSAGE" \ - https://api.pushover.net/1/messages.json - ''; + /run/current-system/sw/bin/curl -s \ + --form-string "token=$APP" \ + --form-string "user=$USER" \ + --form-string "title=$TITLE" \ + --form-string "message=$MESSAGE" \ + https://api.pushover.net/1/messages.json + ''; in { age.secrets = { -- cgit v1.2.3