2019-12-15 12:52:24 +00:00
|
|
|
{ lib, pkgs, config, ... }: {
|
2020-09-16 21:35:26 +00:00
|
|
|
home.packages = [ pkgs.taskwarrior-git ];
|
2019-12-15 12:52:24 +00:00
|
|
|
services.taskwarrior-sync = {
|
|
|
|
enable = true;
|
|
|
|
frequency = "*:0/1";
|
|
|
|
};
|
2021-07-15 12:11:07 +00:00
|
|
|
systemd.user.services.watch-tasks = {
|
|
|
|
Unit.Description = "Watch tasks for changes and trigger sync";
|
|
|
|
Service = {
|
|
|
|
ExecStart = toString (
|
|
|
|
pkgs.writeShellScript "watch-vdir" ''
|
2021-07-16 07:58:42 +00:00
|
|
|
while ${pkgs.coreutils}/bin/sleep 1s; do
|
2021-07-15 12:11:07 +00:00
|
|
|
${pkgs.taskwarrior}/bin/task sync
|
|
|
|
${pkgs.inotify-tools}/bin/inotifywait -e move,create,delete,modify -r ${config.home.homeDirectory}/.task
|
|
|
|
done
|
|
|
|
''
|
|
|
|
);
|
|
|
|
};
|
|
|
|
Install.WantedBy = [ "default.target" ];
|
|
|
|
};
|
2020-12-26 12:21:51 +00:00
|
|
|
home.file = {
|
2020-01-19 18:55:01 +00:00
|
|
|
"add-kassandra-notification" = {
|
|
|
|
target = ".task/hooks/on-add.kassandra-notification";
|
|
|
|
executable = true;
|
|
|
|
text = ''
|
|
|
|
#!${pkgs.bash}/bin/bash
|
2020-01-19 19:16:10 +00:00
|
|
|
${pkgs.coreutils}/bin/tee >(${pkgs.netcat}/bin/nc 127.0.0.1 6545)
|
2020-01-19 18:55:01 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
"modify-kassandra-notification" = {
|
|
|
|
target = ".task/hooks/on-modify.kassandra-notification";
|
|
|
|
executable = true;
|
|
|
|
text = ''
|
|
|
|
#!${pkgs.bash}/bin/bash
|
2020-01-19 19:16:10 +00:00
|
|
|
${pkgs.coreutils}/bin/tail -n 1 | ${pkgs.coreutils}/bin/tee >(${pkgs.netcat}/bin/nc 127.0.0.1 6545)
|
2020-01-19 18:55:01 +00:00
|
|
|
'';
|
|
|
|
};
|
2020-01-10 19:33:05 +00:00
|
|
|
};
|
2020-12-26 12:21:51 +00:00
|
|
|
programs.taskwarrior = {
|
2019-12-15 12:52:24 +00:00
|
|
|
enable = true;
|
2019-12-16 13:50:31 +00:00
|
|
|
dataLocation = "${config.home.homeDirectory}/.task";
|
2019-12-15 12:52:24 +00:00
|
|
|
config = {
|
|
|
|
taskd = {
|
2020-09-30 23:30:40 +00:00
|
|
|
certificate = pkgs.privatePath "taskwarrior/public.cert";
|
|
|
|
credentials = pkgs.privateValue "" "taskwarrior/credentials";
|
|
|
|
ca = pkgs.privatePath "taskwarrior/ca.cert";
|
|
|
|
key = pkgs.privatePath "taskwarrior/private.key";
|
2019-12-15 12:52:24 +00:00
|
|
|
server = "hera.m-0.eu:53589";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
extraConfig = ''
|
|
|
|
alias.inbox=+PENDING -TAGGED limit:1
|
|
|
|
alias.inboxall=+PENDING -TAGGED
|
|
|
|
|
|
|
|
verbose=blank,header,footnote,label,new-id,affected,edit,special,sync
|
|
|
|
nag=
|
|
|
|
|
|
|
|
|
|
|
|
uda.partof.type=string
|
|
|
|
uda.partof.label=Parent task
|
|
|
|
uda.generated.type=string
|
|
|
|
uda.gen_name.type=string
|
|
|
|
uda.gen_name.label=Generator name
|
|
|
|
uda.gen_id.type=string
|
|
|
|
uda.gen_id.label=Generator id
|
|
|
|
uda.gen_orphan.type=string
|
|
|
|
uda.gen_orphan.label=Generated orphan behavior
|
|
|
|
uda.listposition.type=numeric
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|