diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-04-04 20:32:36 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-04-04 20:32:36 +0200 |
commit | 257b07f976b2628c4f6d356b3202a294df816fd2 (patch) | |
tree | 1e02a70ddbe76c5b7bdc8417750123b5fe77751b /modules/by-name/ti/timewarrior/module.nix | |
parent | fix(modules/taskwarrior): Completely move to taskwarrior3 (diff) | |
download | nixos-config-257b07f976b2628c4f6d356b3202a294df816fd2.zip |
refactor(modules/timewarrior): Update the time tracking hooks
Both of them depended on the outdated `taskw` python package, that still used taskwarrior 2.6.
Diffstat (limited to 'modules/by-name/ti/timewarrior/module.nix')
-rw-r--r-- | modules/by-name/ti/timewarrior/module.nix | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/modules/by-name/ti/timewarrior/module.nix b/modules/by-name/ti/timewarrior/module.nix index d262fbe6..bb4d8e26 100644 --- a/modules/by-name/ti/timewarrior/module.nix +++ b/modules/by-name/ti/timewarrior/module.nix @@ -7,49 +7,41 @@ cfg = config.soispha.programs.timewarrior; track_timewarrior = pkgs.stdenv.mkDerivation { - name = "track_timewarrior.taskwarrior-hook"; + name = "track-timewarrior"; nativeBuildInputs = [ pkgs.makeWrapper ]; buildInputs = [ pkgs.timewarrior pkgs.taskwarrior3 - # TODO: Use a `taskw` package, that actually supports newer python variants <2024-07-13> - (pkgs.python311.withPackages (pythonPackages: - with pythonPackages; [ - taskw - ])) + pkgs.python3 ]; dontUnpack = true; installPhase = '' - install -Dm755 ${./taskwarirror_hooks/on-modify_track-timewarrior.py} $out/bin/bin - wrapProgram $out/bin/bin \ - --prefix PATH : ${lib.makeBinPath [pkgs.taskwarrior3 pkgs.timewarrior]} + install -Dm755 ${./taskwarirror_hooks/on-modify.track-timewarrior.py} $out/bin/track-timewarrior + wrapProgram $out/bin/track-timewarrior \ + --set PATH ${lib.makeBinPath [pkgs.taskwarrior3 pkgs.timewarrior]} ''; - meta.mainProgram = "bin"; + meta.mainProgram = "track-timewarrior"; }; track_total_active_time = pkgs.stdenv.mkDerivation { - name = "track_total_active_time.taskwarrior-hook"; + name = "track-total-active-time"; nativeBuildInputs = [ pkgs.makeWrapper ]; buildInputs = [ pkgs.taskwarrior3 - # TODO: Use a `taskw` package, that actually supports newer python variants <2024-07-13> - (pkgs.python311.withPackages (pythonPackages: - with pythonPackages; [ - taskw - ])) + pkgs.python3 ]; 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.taskwarrior3]} + install -Dm755 ${./taskwarirror_hooks/on-modify.track-total-active-time.py} $out/bin/track-total-active-time + wrapProgram $out/bin/track-total-active-time \ + --set PATH ${lib.makeBinPath [pkgs.taskwarrior3]} ''; - meta.mainProgram = "bin"; + meta.mainProgram = "track-total-active-time"; }; in { options.soispha.programs.timewarrior = { |