blob: d6b4dc320825a99cfb9637d4b6522b4b3d7644ee (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
{
config,
lib,
pkgs,
...
}: let
cfg = config.soispha.programs.timewarrior;
track_timewarrior = pkgs.stdenv.mkDerivation {
name = "track_timewarrior.taskwarrior-hook";
nativeBuildInputs = [
pkgs.makeWrapper
];
buildInputs = [
pkgs.timewarrior
pkgs.taskwarrior
# TODO: Use a `taskw` package, that actually supports newer python variants <2024-07-13>
(pkgs.python311.withPackages (pythonPackages:
with pythonPackages; [
taskw
]))
];
dontUnpack = true;
installPhase = ''
install -Dm755 ${./taskwarirror_hooks/on-modify_track-timewarrior.py} $out/bin/bin
wrapProgram $out/bin/bin \
--prefix PATH : ${lib.makeBinPath [pkgs.taskwarrior pkgs.timewarrior]}
'';
meta.mainProgram = "bin";
};
track_total_active_time = pkgs.stdenv.mkDerivation {
name = "track_total_active_time.taskwarrior-hook";
nativeBuildInputs = [
pkgs.makeWrapper
];
buildInputs = [
pkgs.taskwarrior
# TODO: Use a `taskw` package, that actually supports newer python variants <2024-07-13>
(pkgs.python311.withPackages (pythonPackages:
with pythonPackages; [
taskw
]))
];
dontUnpack = true;
installPhase = ''
install -Dm755 ${./taskwarirror_hooks/on-modify_track-total-active-time.py} $out/bin/bin
wrapProgram $out/bin/bin \
--prefix PATH : ${lib.makeBinPath [pkgs.taskwarrior]}
'';
meta.mainProgram = "bin";
};
in {
options.soispha.programs.timewarrior = {
enable = lib.mkEnableOption "timewarrior";
};
config = lib.mkIf cfg.enable {
soispha.programs.taskwarrior = {
hooks = {
track-timewarrior = {
mode = "on-modify";
executable = track_timewarrior;
};
track-total-active-time = {
mode = "on-modify";
executable = track_total_active_time;
};
};
};
home-manager.users.soispha = {
home.packages = [
pkgs.timewarrior
];
xdg.configFile."timewarrior/timewarrior.cfg".text = ''
# source: https://github.com/arcticicestudio/igloo
#+----+
#+ UI +
#+----+
import ${./nord.theme}
color = true
#+---------+
#+ Reports +
#+---------+
define reports:
day:
lines = 10
month = true
week = true
'';
};
};
}
|