From 025cb1e9b0ed6a09f4f7cacbb2ffe9ccb1ad5287 Mon Sep 17 00:00:00 2001 From: Joshua Chapman Date: Mon, 12 Jun 2023 15:57:46 +0200 Subject: [PATCH] timewarrior: install bash completion The completions files are not installed by default, so we need to install them manually. This is done by adding the installShellFiles build input and calling installShellCompletion in postInstall. --- pkgs/applications/misc/timewarrior/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/timewarrior/default.nix b/pkgs/applications/misc/timewarrior/default.nix index 0918b91f48c5..026f5ae5014e 100644 --- a/pkgs/applications/misc/timewarrior/default.nix +++ b/pkgs/applications/misc/timewarrior/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, cmake, asciidoctor }: +{ lib, stdenv, fetchFromGitHub, cmake, asciidoctor, installShellFiles }: stdenv.mkDerivation rec { pname = "timewarrior"; @@ -12,10 +12,15 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; - nativeBuildInputs = [ cmake asciidoctor ]; + nativeBuildInputs = [ cmake asciidoctor installShellFiles ]; dontUseCmakeBuildDir = true; + postInstall = '' + installShellCompletion --cmd timew \ + --bash completion/timew-completion.bash + ''; + meta = with lib; { description = "A command-line time tracker"; homepage = "https://timewarrior.net";