From 1b744b912d783c40ddc4d6cafb2e7dd7cd692386 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 31 Dec 2023 12:13:01 +0100 Subject: fix(hm/conf/task/hooks/): Correctly wrap python hooks to add timewarrior --- hm/soispha/conf/taskwarrior/hooks/default.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'hm/soispha/conf/taskwarrior/hooks') diff --git a/hm/soispha/conf/taskwarrior/hooks/default.nix b/hm/soispha/conf/taskwarrior/hooks/default.nix index a8ce09cc..429db108 100644 --- a/hm/soispha/conf/taskwarrior/hooks/default.nix +++ b/hm/soispha/conf/taskwarrior/hooks/default.nix @@ -42,7 +42,10 @@ }; track_timewarrior = pkgs.stdenv.mkDerivation { name = "track_timewarrior.taskwarrior-hook"; - propagatedBuildInputs = [ + nativeBuildInputs = [ + pkgs.makeWrapper + ]; + buildInputs = [ pkgs.timewarrior pkgs.taskwarrior (pkgs.python3.withPackages (pythonPackages: @@ -52,10 +55,17 @@ ]; dontUnpack = true; installPhase = "install -Dm755 ${./scripts/on-modify_track-timewarrior.py} $out/bin/bin"; + postInstall = '' + wrapProgram $out/bin/bin \ + --prefix PATH : ${lib.makeBinPath [pkgs.taskwarrior pkgs.timewarrior]} + ''; }; track_total_active_time = pkgs.stdenv.mkDerivation { name = "track_total_active_time.taskwarrior-hook"; - propagatedBuildInputs = [ + nativeBuildInputs = [ + pkgs.makeWrapper + ]; + buildInputs = [ pkgs.taskwarrior (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [ @@ -64,6 +74,10 @@ ]; dontUnpack = true; installPhase = "install -Dm755 ${./scripts/on-modify_track-total-active-time.py} $out/bin/bin"; + postInstall = '' + wrapProgram $out/bin/bin \ + --prefix PATH : ${lib.makeBinPath [pkgs.taskwarrior]} + ''; }; mkSyncGitRepo = type: { -- cgit 1.4.1