🚑 hotfix bugwarrior by introducing bugwarrior-sync

This commit is contained in:
Ingolf Wagner 2024-09-05 20:48:01 +07:00
parent 9aa5e1ef09
commit 903e963d05
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
2 changed files with 39 additions and 4 deletions

View file

@ -63,8 +63,34 @@ in
config = mkIf config.gui.enable { config = mkIf config.gui.enable {
home.file.".config/bugwarrior/bugwarrior.toml".source = home.file.".config/bugwarrior/bugwarrior.toml".source =
(pkgs.formats.toml { }).generate "bugwarriorrc.toml" (pkgs.formats.toml { }).generate "bugwarriorrc.toml"
config.bugwarrior.config; (
home.packages = [ pkgs.bugwarrior ]; {
general.taskrc = pkgs.writeText "taskrc" "data.location=$HOME/.bugwarrior";
}
// config.bugwarrior.config
);
home.packages = [
pkgs.bugwarrior
#export TASKRC=$HOME/.bugwarrior/${pkgs.writeText "bugwarrior.taskrc" "data.location=$HOME/.bugwarrior"}
(pkgs.writers.writeBashBin "bugwarrior-sync" ''
set -eo pipefail
mkdir -p $HOME/.bugwarrior
touch $HOME/.bugwarrior/taskrc
export TASKRC=$HOME/.bugwarrior/taskrc
export TASKDATA=$HOME/.bugwarrior
echo "bugwarrior pull" | ${pkgs.boxes}/bin/boxes -d ansi
${pkgs.bugwarrior}/bin/bugwarrior pull "$@"
echo "task export" | ${pkgs.boxes}/bin/boxes -d ansi
${pkgs.taskwarrior}/bin/task export > $HOME/.bugwarrior/bugwarrior.json
unset TASKRC
unset TASKDATA
echo "task import" | ${pkgs.boxes}/bin/boxes -d ansi
${taskwarrior}/bin/task import rc.hooks=0 $HOME/.bugwarrior/bugwarrior.json
'')
];
}; };
} }

View file

@ -63,10 +63,19 @@
targets = [ targets = [
"terranix" "terranix"
"my_github" "my_github"
"logseq"
]; ];
log_level = "INFO"; log_level = "INFO";
static_fields = [ "priority" ]; static_fields = [ "priority" ];
merge_annotations = false; merge_annotations = false;
taskrc = pkgs.writeText "taskrc" ''
data.location=$HOME/.bugwarrior
'';
};
logseq = {
service = "logseq";
add_tags = "bugwarrior,logseq";
description_template = "{{logseqtitle}}";
}; };
terranix = { terranix = {
service = "github"; service = "github";
@ -75,7 +84,7 @@
username = "mrVanDalo"; username = "mrVanDalo";
default_priority = ""; default_priority = "";
description_template = "{{githubtitle}} {{githuburl}}"; description_template = "{{githubtitle}} {{githuburl}}";
add_tags = "github"; add_tags = "bugwarrior,github";
project_template = "terranix"; project_template = "terranix";
involved_issues = true; involved_issues = true;
query = "org:terranix is:open"; query = "org:terranix is:open";
@ -88,7 +97,7 @@
token = "@oracle:eval:${pkgs.pass}/bin/pass development/github/mrVanDalo/bugwarriorAccessToken"; token = "@oracle:eval:${pkgs.pass}/bin/pass development/github/mrVanDalo/bugwarriorAccessToken";
username = "mrVanDalo"; username = "mrVanDalo";
description_template = "{{githubtitle}} {{githuburl}}"; description_template = "{{githubtitle}} {{githuburl}}";
add_tags = "github"; add_tags = "bugwarrior,github";
include_user_issues = true; include_user_issues = true;
include_user_repos = true; include_user_repos = true;
exclude_repos = [ exclude_repos = [