.dotfiles/pkgs/flake/github-notifications/default.nix
Leon Schwarzäugl ec6ae25e9b
Some checks failed
Flake check / Check flake (push) Has been cancelled
fix[work]: fix aws,cdr commands, easier git switch in emacs
2025-11-19 21:49:30 +01:00

13 lines
336 B
Nix

{ name, writeShellApplication, jq, ... }:
writeShellApplication {
inherit name;
runtimeInputs = [ jq ];
text = ''
count=$(curl -u Swarsel:"$(cat "$GITHUB_NOTIFICATION_TOKEN_PATH")" https://api.github.com/notifications | jq '. | length')
if [[ "$count" != "0" ]]; then
echo "{\"text\":\"$count\"}"
fi
'';
}