aboutsummaryrefslogtreecommitdiff
path: root/modules/calendar.home/orgmode-notifier.module.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/calendar.home/orgmode-notifier.module.nix')
-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;
+ };
+}