1{ lib, stdenv, fetchFromGitHub, rustPlatform, installShellFiles, Security, libiconv, Libsystem }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "procs";
5 version = "0.14.0";
6
7 src = fetchFromGitHub {
8 owner = "dalance";
9 repo = "procs";
10 rev = "v${version}";
11 hash = "sha256-DoH9XxPRKGd+tex8MdbtkhM+V8C1wDMv/GZcB4aMCPc=";
12 };
13
14 cargoHash = "sha256-B+LpUErsvtLYn+Xvq4KNBpLR9WYe38yMWHUNsd9jIs8=";
15
16 nativeBuildInputs = [ installShellFiles ]
17 ++ lib.optionals stdenv.isDarwin [ rustPlatform.bindgenHook ];
18
19 postInstall = ''
20 for shell in bash fish zsh; do
21 $out/bin/procs --gen-completion $shell
22 done
23 installShellCompletion procs.{bash,fish} --zsh _procs
24 '';
25
26 buildInputs = lib.optionals stdenv.isDarwin [ Security libiconv Libsystem ];
27
28 meta = with lib; {
29 description = "A modern replacement for ps written in Rust";
30 homepage = "https://github.com/dalance/procs";
31 changelog = "https://github.com/dalance/procs/raw/v${version}/CHANGELOG.md";
32 license = licenses.mit;
33 maintainers = with maintainers; [ Br1ght0ne SuperSandro2000 sciencentistguy ];
34 };
35}