From e0634a39a579ce3ee2da48e0ead421ebf49cccbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Thu, 28 Jan 2021 17:17:09 +0100 Subject: [PATCH] procs: add shell completions --- pkgs/tools/admin/procs/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/admin/procs/default.nix b/pkgs/tools/admin/procs/default.nix index 9ce66e3c2d7..c4139345908 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; {