about summary refs log tree commit diff
path: root/pkgs/tools/misc/tldr
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2022-04-14 04:20:00 +0000
committerMario Rodas <marsam@users.noreply.github.com>2022-04-14 04:20:00 +0000
commitc8c6adced1331844ea047dc921f4e9335dff85aa (patch)
tree1453ce106173bcf9dc6e3f913180ad3af8052c2d /pkgs/tools/misc/tldr
parent641257cc96ee8d12fc0fb5f541625e1939ecd700 (diff)
tldr: install completions
Diffstat (limited to 'pkgs/tools/misc/tldr')
-rw-r--r--pkgs/tools/misc/tldr/default.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/tools/misc/tldr/default.nix b/pkgs/tools/misc/tldr/default.nix
index 141a6afb66b32..698236ada183a 100644
--- a/pkgs/tools/misc/tldr/default.nix
+++ b/pkgs/tools/misc/tldr/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, curl, libzip, pkg-config }:
+{ lib, stdenv, fetchFromGitHub, curl, libzip, pkg-config, installShellFiles }:
 
 stdenv.mkDerivation rec {
   pname = "tldr";
@@ -12,12 +12,16 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ curl libzip ];
-  nativeBuildInputs = [ pkg-config ];
+  nativeBuildInputs = [ pkg-config installShellFiles ];
 
   makeFlags = ["CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc" "CFLAGS="];
 
   installFlags = [ "PREFIX=$(out)" ];
 
+  postInstall = ''
+    installShellCompletion --cmd tldr autocomplete/complete.{bash,fish,zsh}
+  '';
+
   meta = with lib; {
     description = "Simplified and community-driven man pages";
     longDescription = ''