aboutsummaryrefslogtreecommitdiff
path: root/modules/scripts/pushover
diff options
context:
space:
mode:
authortdback <tyler@tdback.net>2025-01-05 12:37:34 -0500
committertdback <tyler@tdback.net>2025-01-05 12:37:34 -0500
commitff80e2841c2ccbaa0df325269b8a89076da6ce43 (patch)
tree5bfe209c063845e110127e42f266bde425b90891 /modules/scripts/pushover
parent30ffe9856a1ef62f8413fe44b33c8545460bac48 (diff)
cleanup scripts
Diffstat (limited to 'modules/scripts/pushover')
-rw-r--r--modules/scripts/pushover/default.nix13
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/scripts/pushover/default.nix b/modules/scripts/pushover/default.nix
index cedfb20..a5644e4 100644
--- a/modules/scripts/pushover/default.nix
+++ b/modules/scripts/pushover/default.nix
@@ -1,9 +1,7 @@
{ inputs, config, pkgs, ... }:
let
pushover = pkgs.writeShellScriptBin "pushover" ''
- #!/bin/sh
-
- die() { echo "$0: $*" >&2; exit 111; }
+ set -e
APP=$(cat ${config.age.secrets.pushoverAppToken.path})
USER=$(cat ${config.age.secrets.pushoverUserToken.path})
@@ -14,10 +12,12 @@ let
TITLE="$OPTARG"
;;
:)
- die "missing option argument for -$OPTARG"
+ echo "missing option argument for -$OPTARG" >&2
+ exit 1
;;
*)
- die "invalid option -$OPTARG"
+ echo "invalid option -$OPTARG" >&2
+ exit 1
;;
esac
done
@@ -35,8 +35,7 @@ let
--form-string "message=$MESSAGE" \
https://api.pushover.net/1/messages.json
'';
-in
-{
+in {
age.secrets = {
pushoverAppToken.file = "${inputs.self}/secrets/pushoverAppToken.age";
pushoverUserToken.file = "${inputs.self}/secrets/pushoverUserToken.age";