about summary refs log tree commit diff
path: root/pkgs/applications/misc
diff options
context:
space:
mode:
authorJoshua Chapman <joshua.chapman@joshuachp.dev>2023-06-12 15:57:46 +0200
committerJoshua Chapman <joshua.chapman@joshuachp.dev>2023-06-12 16:32:29 +0200
commit025cb1e9b0ed6a09f4f7cacbb2ffe9ccb1ad5287 (patch)
tree88f39aa6552ff6f6342723517123a027d0f06a44 /pkgs/applications/misc
parent328bcf4d57f14f35f2e55d6ec3283c0bc8fd6892 (diff)
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.
Diffstat (limited to 'pkgs/applications/misc')
-rw-r--r--pkgs/applications/misc/timewarrior/default.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/applications/misc/timewarrior/default.nix b/pkgs/applications/misc/timewarrior/default.nix
index 0918b91f48c52..026f5ae5014eb 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";