From 06b23af29d434f448faebf822d5f1f1e8a0c0a39 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 27 Jan 2019 20:32:04 +0100 Subject: reaktor2 task: define env in hook --- krebs/2configs/reaktor2.nix | 48 +++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 32 deletions(-) (limited to 'krebs') 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" + ''; }; }; -- cgit v1.2.3