about summary refs log tree commit diff
path: root/pkgs/development/tools/pet
diff options
context:
space:
mode:
authorilkecan <ilkecan@protonmail.com>2022-09-20 07:36:40 +0000
committerilkecan <ilkecan@protonmail.com>2022-09-20 07:36:40 +0000
commit731ff64aed709874e5d8fcc8e4ba996495844da8 (patch)
treebf6d80668fac475c9d6452509cb59a62f43f3c78 /pkgs/development/tools/pet
parent24ac72e8a18942e827154c334d0bc41c22bdc536 (diff)
pet: install zsh completion file
Diffstat (limited to 'pkgs/development/tools/pet')
-rw-r--r--pkgs/development/tools/pet/default.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/development/tools/pet/default.nix b/pkgs/development/tools/pet/default.nix
index d759efb2b5b70..d51aa05612867 100644
--- a/pkgs/development/tools/pet/default.nix
+++ b/pkgs/development/tools/pet/default.nix
@@ -1,4 +1,4 @@
-{ buildGoModule, fetchFromGitHub, lib }:
+{ buildGoModule, fetchFromGitHub, installShellFiles, lib }:
 
 buildGoModule rec {
   pname = "pet";
@@ -17,6 +17,15 @@ buildGoModule rec {
 
   subPackages = [ "." ];
 
+  nativeBuildInputs = [
+    installShellFiles
+  ];
+
+  postInstall = ''
+    installShellCompletion --cmd pet \
+      --zsh ./misc/completions/zsh/_pet
+  '';
+
   meta = with lib; {
     description = "Simple command-line snippet manager, written in Go";
     homepage = "https://github.com/knqyf263/pet";