summary refs log tree commit diff
path: root/pkgs/tools/admin/procs
diff options
context:
space:
mode:
authorDaniël de Kok <me@danieldk.eu>2021-01-28 17:17:09 +0100
committerDaniël de Kok <me@danieldk.eu>2021-01-28 17:17:09 +0100
commite0634a39a579ce3ee2da48e0ead421ebf49cccbf (patch)
tree7502640aec8e71767e52539aec0ebc63493582b8 /pkgs/tools/admin/procs
parent86a911f4140e49e45cc204c5bbd6ff37e4e4e862 (diff)
procs: add shell completions
Diffstat (limited to 'pkgs/tools/admin/procs')
-rw-r--r--pkgs/tools/admin/procs/default.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/tools/admin/procs/default.nix b/pkgs/tools/admin/procs/default.nix
index 9ce66e3c2d714..c413934590874 100644
--- a/pkgs/tools/admin/procs/default.nix
+++ b/pkgs/tools/admin/procs/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, rustPlatform, Security }:
+{ lib, stdenv, fetchFromGitHub, rustPlatform, installShellFiles, Security }:
 
 rustPlatform.buildRustPackage rec {
   pname = "procs";
@@ -13,6 +13,15 @@ rustPlatform.buildRustPackage rec {
 
   cargoSha256 = "sha256-ilSDLbPQnmhQcNbtKCpUNmyZY0JUY/Ksg0sj/t7veT0=";
 
+  nativeBuildInputs = [ installShellFiles ];
+
+  postInstall = ''
+    for shell in bash fish zsh; do
+      $out/bin/procs --completion $shell > procs.$shell
+      installShellCompletion procs.$shell
+    done
+  '';
+
   buildInputs = lib.optional stdenv.isDarwin Security;
 
   meta = with lib; {