aboutsummaryrefslogtreecommitdiff
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
parent1e52ce372783806b98fa0578e0b17a3c169829e3 (diff)
downloadnixos-config-04de6d0335187224d73c45b770a270057effafea.tar.gz
nixos-config-04de6d0335187224d73c45b770a270057effafea.zip
Add orgmode notifier timer+service
m---------config/nvim0
-rw-r--r--modules/calendar.home/default.nix12
-rw-r--r--modules/calendar.home/orgmode-notifier.module.nix33
3 files changed, 43 insertions, 2 deletions
diff --git a/config/nvim b/config/nvim
-Subproject 18a7b8312709b60633498914e183c878d9cbfe4
+Subproject 3175f83b3c12ed36214798fe479e18d3f10f928
diff --git a/modules/calendar.home/default.nix b/modules/calendar.home/default.nix
index 997e2eb..06ea982 100644
--- a/modules/calendar.home/default.nix
+++ b/modules/calendar.home/default.nix
@@ -3,13 +3,16 @@ let
private = import ./private.nix;
in
{
- imports = [ ./ical2org.module.nix ];
+ imports = [
+ ./ical2org.module.nix
+ ./orgmode-notifier.module.nix
+ ];
services.ical2org = {
enable = true;
icalLink = private.icalLink;
outputPath = "${config.home.homeDirectory}/nixos/extras/notes/calendar-sync.autogen.org";
- syncFrequency = "*:0/10";
+ syncFrequency = "*:0/10"; # Every 10 minutes
settings = {
filetags = "calendar";
email = private.email;
@@ -20,4 +23,9 @@ in
future = 30; # days
};
};
+
+ services.orgmode-notifier = {
+ enable = true;
+ pollFrequency = "*:0/1"; # Every minute
+ };
}
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;
+ };
+}