aboutsummaryrefslogtreecommitdiff
path: root/modules/calendar.home/orgmode-notifier.module.nix
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-06-06 14:25:40 +0530
committerAkshay Nair <phenax5@gmail.com>2025-06-06 14:25:40 +0530
commit04de6d0335187224d73c45b770a270057effafea (patch)
tree9b42410d30ce7e0ffab4c834feb26443c188593b /modules/calendar.home/orgmode-notifier.module.nix
parent1e52ce372783806b98fa0578e0b17a3c169829e3 (diff)
downloadnixos-config-04de6d0335187224d73c45b770a270057effafea.tar.gz
nixos-config-04de6d0335187224d73c45b770a270057effafea.zip
Add orgmode notifier timer+service
Diffstat (limited to '')
-rw-r--r--modules/calendar.home/orgmode-notifier.module.nix33
1 files changed, 33 insertions, 0 deletions
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;
+ };
+}