2019-10-24 02:20:38 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.custom.taskwarrior;
|
2020-01-24 11:20:10 +01:00
|
|
|
unstable = import <nixpkgs-unstable> { };
|
2019-10-24 02:20:38 +02:00
|
|
|
|
2019-12-20 05:54:26 +01:00
|
|
|
taskNextWeek = pkgs.writeShellScriptBin "taskweek" # sh
|
|
|
|
''
|
|
|
|
${pkgs.taskwarrior}/bin/task \
|
|
|
|
export \
|
|
|
|
status:pending and \( due.before:6days \) \
|
|
|
|
| ${pkgs.jq}/bin/jq '[.[] | { Day: .due, ID: .id, Description: .description } ] | sort_by(.Day)' \
|
|
|
|
| ${pkgs.miller}/bin/mlr --ijson --opprint put "\$Day = strftime(strptime(\$Day,\"%Y%m%dT%H%M%SZ\")$(date +%z)00,\"%A\")"
|
|
|
|
'';
|
|
|
|
|
|
|
|
tsak = pkgs.writeShellScriptBin "tsak" # sh
|
|
|
|
''
|
|
|
|
${pkgs.taskwarrior}/bin/task "$@"
|
|
|
|
'';
|
2019-10-24 02:20:38 +02:00
|
|
|
|
|
|
|
in {
|
|
|
|
|
2019-12-20 05:54:26 +01:00
|
|
|
options.programs.custom.taskwarrior.enable =
|
|
|
|
mkEnableOption "Enable Taskwarrior services";
|
2019-10-24 02:20:38 +02:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
taskwarrior
|
|
|
|
timewarrior
|
|
|
|
tasksh
|
|
|
|
taskNextWeek
|
|
|
|
tsak
|
|
|
|
|
2020-03-10 04:27:20 +01:00
|
|
|
(unstable.vit.overrideAttrs (old: rec {
|
|
|
|
name = "vit-${version}";
|
|
|
|
version = "master";
|
|
|
|
src = pkgs.fetchgit {
|
|
|
|
url = "https://github.com/scottkosty/vit.git";
|
|
|
|
rev = "41d046e86c1ff73a95d78b66149e3fb30a6aac85";
|
|
|
|
sha256 = "0xkh5hiryh7nwi17wrp1pxscbw0a2fdw349mhgvx59hafpkf13nv";
|
|
|
|
};
|
|
|
|
}))
|
2020-01-23 11:47:59 +01:00
|
|
|
|
2019-10-24 02:20:38 +02:00
|
|
|
python # needed for hooks
|
2019-12-26 00:55:02 +01:00
|
|
|
|
2019-12-29 02:55:15 +01:00
|
|
|
taskwarrior-hooks
|
|
|
|
|
2019-12-27 01:10:49 +01:00
|
|
|
# bugwarrior
|
|
|
|
(let
|
|
|
|
mypython = let
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
bugwarrior = super.bugwarrior.overridePythonAttrs (old: {
|
|
|
|
propagatedBuildInputs = old.propagatedBuildInputs
|
|
|
|
++ [ super.setuptools ];
|
|
|
|
});
|
|
|
|
};
|
|
|
|
in pkgs.python3.override { inherit packageOverrides; };
|
|
|
|
in mypython.pkgs.bugwarrior)
|
|
|
|
|
2019-10-24 02:20:38 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|