reaktor2 task: define env in hook

This commit is contained in:
tv 2019-01-27 20:32:04 +01:00
parent f608351da1
commit 06b23af29d

View File

@ -18,41 +18,25 @@ let
activate = "match"; activate = "match";
command = 1; command = 1;
arguments = [2]; arguments = [2];
env.TASKDATA = "${stateDir}/${name}";
commands = { commands = {
add = { add.filename = pkgs.writeDash "${name}-task-add" ''
env = { ${pkgs.taskwarrior}/bin/task rc:${rcFile} add "$1"
TASKDATA = "${stateDir}/${name}";
};
filename = pkgs.writeDash "${name}-task-add" ''
${pkgs.taskwarrior}/bin/task rc:${rcFile} add "$*"
''; '';
}; list.filename = pkgs.writeDash "${name}-task-list" ''
list = { ${pkgs.taskwarrior}/bin/task rc:${rcFile} export \
env = { | ${pkgs.jq}/bin/jq -r '
TASKDATA = "${stateDir}/${name}"; .[] | select(.id != 0) | "\(.id) \(.description)"
}; '
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" ''
delete = { ${pkgs.taskwarrior}/bin/task rc:${rcFile} delete "$1"
env = {
TASKDATA = "${stateDir}/${name}";
};
filename = pkgs.writeDash "${name}-task-delete" ''
${pkgs.taskwarrior}/bin/task rc:${rcFile} delete "$*"
''; '';
}; done.filename = pkgs.writeDash "${name}-task-done" ''
done = { ${pkgs.taskwarrior}/bin/task rc:${rcFile} done "$1"
env = {
TASKDATA = "${stateDir}/${name}";
};
filename = pkgs.writeDash "${name}-task-done" ''
${pkgs.taskwarrior}/bin/task rc:${rcFile} done "$*"
''; '';
}; };
}; };
};
systemPlugin = { systemPlugin = {
plugin = "system"; plugin = "system";