aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-04 22:31:24 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-04 22:31:24 +0200
commitecf41040c669819f907f4835e83f11983c226405 (patch)
tree7128cc151d353349992b93ab642a540d54ebec9f /modules
parentfix(modules/taskwarrior): Print hook `die` to stderr (diff)
downloadnixos-config-ecf41040c669819f907f4835e83f11983c226405.zip
fix(modules/taskwarrior): Correctly detect if hook debug is set
`task _get` is not influenced by a temporary CLI override.
Diffstat (limited to 'modules')
-rw-r--r--modules/by-name/ta/taskwarrior/module.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/by-name/ta/taskwarrior/module.nix b/modules/by-name/ta/taskwarrior/module.nix
index ec3152b7..f23733a4 100644
--- a/modules/by-name/ta/taskwarrior/module.nix
+++ b/modules/by-name/ta/taskwarrior/module.nix
@@ -34,8 +34,13 @@
}
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 --quite 'rc.debug.hooks='; then
+ set -x
+ mkdir --parents "~/.cache/task"
+ exec >>"~/.cache/task/hook.log.$0"
+ exec 2>>""~/.cache/task/hook.log.$0"
+ fi
}
addedCall() {