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"]; + }; + }; +}