summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2019-01-27 20:32:04 +0100
committertv <tv@krebsco.de>2019-01-27 20:32:04 +0100
commit06b23af29d434f448faebf822d5f1f1e8a0c0a39 (patch)
tree95120c20118d6843201452ed82bbac93f7f53880 /krebs
parentf608351da19aeae5fd06dd700a8f11150433d15e (diff)
reaktor2 task: define env in hook
Diffstat (limited to 'krebs')
-rw-r--r--krebs/2configs/reaktor2.nix48
1 files changed, 16 insertions, 32 deletions
diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix
index 2beb6561b..ff6b539ba 100644
--- a/krebs/2configs/reaktor2.nix
+++ b/krebs/2configs/reaktor2.nix
@@ -18,39 +18,23 @@ let
activate = "match";
command = 1;
arguments = [2];
+ env.TASKDATA = "${stateDir}/${name}";
commands = {
- add = {
- env = {
- TASKDATA = "${stateDir}/${name}";
- };
- filename = pkgs.writeDash "${name}-task-add" ''
- ${pkgs.taskwarrior}/bin/task rc:${rcFile} add "$*"
- '';
- };
- list = {
- env = {
- TASKDATA = "${stateDir}/${name}";
- };
- filename = pkgs.writeDash "${name}-task-list" ''
- ${pkgs.taskwarrior}/bin/task rc:${rcFile} export | ${pkgs.jq}/bin/jq -r '.[] | select(.id != 0) | "\(.id) \(.description)"'
- '';
- };
- delete = {
- env = {
- TASKDATA = "${stateDir}/${name}";
- };
- filename = pkgs.writeDash "${name}-task-delete" ''
- ${pkgs.taskwarrior}/bin/task rc:${rcFile} delete "$*"
- '';
- };
- done = {
- env = {
- TASKDATA = "${stateDir}/${name}";
- };
- filename = pkgs.writeDash "${name}-task-done" ''
- ${pkgs.taskwarrior}/bin/task rc:${rcFile} done "$*"
- '';
- };
+ add.filename = pkgs.writeDash "${name}-task-add" ''
+ ${pkgs.taskwarrior}/bin/task rc:${rcFile} add "$1"
+ '';
+ list.filename = pkgs.writeDash "${name}-task-list" ''
+ ${pkgs.taskwarrior}/bin/task rc:${rcFile} export \
+ | ${pkgs.jq}/bin/jq -r '
+ .[] | select(.id != 0) | "\(.id) \(.description)"
+ '
+ '';
+ delete.filename = pkgs.writeDash "${name}-task-delete" ''
+ ${pkgs.taskwarrior}/bin/task rc:${rcFile} delete "$1"
+ '';
+ done.filename = pkgs.writeDash "${name}-task-done" ''
+ ${pkgs.taskwarrior}/bin/task rc:${rcFile} done "$1"
+ '';
};
};