summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/misc/process-viewer/default.nix
blob: 442f9d0e9b50b4993dad86a1d14f66075889297f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ lib
, rustPlatform
, fetchCrate
, pkg-config
, gtk4
, stdenv
, DiskArbitration
, Foundation
, IOKit
}:

rustPlatform.buildRustPackage rec {
  pname = "process-viewer";
  version = "0.5.5";

  src = fetchCrate {
    inherit pname version;
    sha256 = "sha256-MHVKjbD1/h7G94x6dpyRT/BPWQVUFurW7EvAUJ2xZeU=";
  };

  cargoSha256 = "sha256-NkJjwB4rBV4hFRwYHILMET8o4x1+95sVsFqNaVN8tMg=";

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [ gtk4 ] ++ lib.optionals stdenv.isDarwin [
    DiskArbitration
    Foundation
    IOKit
  ];

  postInstall = ''
    install -Dm644 assets/fr.guillaume_gomez.ProcessViewer.desktop -t $out/share/applications
    install -Dm644 assets/fr.guillaume_gomez.ProcessViewer.svg -t $out/share/icons/hicolor/scalable/apps
    install -Dm644 assets/fr.guillaume_gomez.ProcessViewer.metainfo.xml -t $out/share/metainfo
  '';

  meta = with lib; {
    description = "A process viewer GUI in rust";
    homepage = "https://github.com/guillaumegomez/process-viewer";
    license = licenses.mit;
    maintainers = with maintainers; [ figsoda ];
    mainProgram = "process_viewer";
  };
}