From afe36153298cebc06b4d153b2d7a0803d5cb2bb4 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 8 Aug 2024 13:35:09 +0200 Subject: [PATCH] Add gh-notify service & timer --- home/services/default.nix | 1 + home/services/gh-notify.nix | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 home/services/gh-notify.nix diff --git a/home/services/default.nix b/home/services/default.nix index d1a6cb7..20e9699 100644 --- a/home/services/default.nix +++ b/home/services/default.nix @@ -3,5 +3,6 @@ _: { ./dunst.nix ./hyprpaper.nix ./hypridle.nix + ./gh-notify.nix ]; } diff --git a/home/services/gh-notify.nix b/home/services/gh-notify.nix new file mode 100644 index 0000000..1b2a894 --- /dev/null +++ b/home/services/gh-notify.nix @@ -0,0 +1,31 @@ +{ + lib, + pkgs, + ... +}: let + inherit (lib) getExe; + + scriptPkgs = import ../packages/cli/scripts/packages {inherit pkgs;}; +in { + systemd.user = { + services.gh-notify = { + Unit = { + Description = "Show unread GitHub notifications"; + After = ["dunst.service"]; + }; + Install.WantedBy = ["graphical-session.target"]; + Service = { + ExecStart = "${getExe scriptPkgs.gh-notify} -vv"; + Type = "oneshot"; + RemainAfterExit = false; + Restart = "on-failure"; + RestartSec = "3s"; + }; + }; + timers.gh-notify = { + Unit.Description = "Timer of GitHub notification sendout"; + Timer.OnUnitActiveSec = "1m"; + Install.WantedBy = ["graphical-session.target"]; + }; + }; +}