1{
2 lib,
3 stdenv,
4 buildPackages,
5 fetchFromGitHub,
6 rustPlatform,
7 installShellFiles,
8 libiconv,
9}:
10
11rustPlatform.buildRustPackage rec {
12 pname = "procs";
13 version = "0.14.10";
14
15 src = fetchFromGitHub {
16 owner = "dalance";
17 repo = "procs";
18 rev = "v${version}";
19 hash = "sha256-+qY0BG3XNCm5vm5W6VX4a0JWCb4JSat/oK9GLXRis/M=";
20 };
21
22 cargoHash = "sha256-/y+9EA3PhyI5iqg2wM0ny41nBDJiKnsjvbmPfCe5RJk=";
23
24 nativeBuildInputs = [
25 installShellFiles
26 ]
27 ++ lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ];
28
29 postInstall = ''
30 for shell in bash fish zsh; do
31 ${stdenv.hostPlatform.emulator buildPackages} $out/bin/procs --gen-completion $shell
32 done
33 installShellCompletion procs.{bash,fish} --zsh _procs
34 '';
35
36 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
37 libiconv
38 ];
39
40 meta = {
41 description = "Modern replacement for ps written in Rust";
42 homepage = "https://github.com/dalance/procs";
43 changelog = "https://github.com/dalance/procs/raw/v${version}/CHANGELOG.md";
44 license = lib.licenses.mit;
45 maintainers = with lib.maintainers; [
46 Br1ght0ne
47 sciencentistguy
48 ];
49 mainProgram = "procs";
50 };
51}