about summary refs log tree commit diff stats
path: root/modules/by-name/ta/taskwarrior
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--modules/by-name/ta/taskwarrior/module.nix21
1 files changed, 15 insertions, 6 deletions
diff --git a/modules/by-name/ta/taskwarrior/module.nix b/modules/by-name/ta/taskwarrior/module.nix
index 3d53706c..2c1f91c2 100644
--- a/modules/by-name/ta/taskwarrior/module.nix
+++ b/modules/by-name/ta/taskwarrior/module.nix
@@ -23,19 +23,24 @@
 
     executable = pkgs.writeShellApplication {
       name = "add-hook-${builtins.baseNameOf path}";
-      runtimeInputs = [pkgs.taskwarrior pkgs.coreutils] ++ deps;
+      runtimeInputs = [pkgs.taskwarrior3 pkgs.coreutils pkgs.gnugrep] ++ deps;
       inheritPath = false;
       text =
         # bash
         ''
           die() {
-            echo "$@"
+            echo "$@">&2
             exit 1
           }
 
           enable_hook_dbg() {
-              debug_hooks="$(task _get rc.debug.hooks)"
-              [ "$debug_hooks" ] && [ "$debug_hooks" -ge 1 ] && set -x
+              # TODO: We should probably be smarter with the debug detection <2025-04-04>
+              if echo "$2" | grep --quiet 'rc.debug.hooks='; then
+                set -x
+                mkdir --parents "$HOME/.cache/task"
+                exec >>"$HOME/.cache/task/hook.log.$1"
+                exec 2>>"$HOME/.cache/task/hook.log.$1"
+              fi
           }
 
           addedCall() {
@@ -51,7 +56,7 @@
           # We don't change the task, thus immediately return the JSON
           echo "$new_task"
 
-          enable_hook_dbg
+          enable_hook_dbg "$@"
           addedCall "$new_task" "$old_task"
 
           exit 0
@@ -91,17 +96,19 @@ in {
 
   config = {
     lib.taskwarrior = {
-      mkHook = mkHook;
+      inherit mkHook;
     };
 
     home-manager.users.soispha = lib.mkIf cfg.enable {
       services.taskwarrior-sync = {
         enable = true;
+        package = pkgs.taskwarrior3;
       };
 
       programs.taskwarrior = {
         enable = true;
         colorTheme = ./nord.theme;
+        package = pkgs.taskwarrior3;
         extraConfig = cfg.includeFiles;
 
         config = {
@@ -111,6 +118,8 @@ in {
             tags = true;
           };
 
+          news.version = "3.4.1";
+
           regex = true;
           weekstart = "Monday";