From 04de6d0335187224d73c45b770a270057effafea Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 6 Jun 2025 14:25:40 +0530 Subject: Add orgmode notifier timer+service --- modules/calendar.home/orgmode-notifier.module.nix | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 modules/calendar.home/orgmode-notifier.module.nix (limited to 'modules/calendar.home/orgmode-notifier.module.nix') diff --git a/modules/calendar.home/orgmode-notifier.module.nix b/modules/calendar.home/orgmode-notifier.module.nix new file mode 100644 index 0000000..b33c2fe --- /dev/null +++ b/modules/calendar.home/orgmode-notifier.module.nix @@ -0,0 +1,33 @@ +{ config, pkgs, lib, ... }: +with lib; +let + cfg = config.services.orgmode-notifier; + + service-unit = { + Service = { + Type = "oneshot"; + ExecStart = "${config.xdg.configHome}/nvim/orgmode_notifier.sh"; + WorkingDirectory = config.home.homeDirectory; + Environment = "PATH=${pkgs.neovim}/bin:${pkgs.libnotify}/bin:/usr/bin:/bin"; + }; + }; + + timer-unit = { + Timer = { + OnCalendar = cfg.pollFrequency; + RandomizedDelaySec = 30; + }; + Install.WantedBy = [ "timers.target" ]; + }; +in { + options.services.orgmode-notifier = { + enable = mkEnableOption "orgmode notifier"; + pollFrequency = mkOption { type = types.str; default = "*:0/1"; }; + }; + + config = mkIf cfg.enable { + programs.lieer.enable = true; + systemd.user.services.orgmode-notifier = service-unit; + systemd.user.timers.orgmode-notifier = timer-unit; + }; +} -- cgit v1.3.1