1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 autoAddDriverRunpath,
6 installShellFiles,
7 versionCheckHook,
8 nix-update-script,
9}:
10
11rustPlatform.buildRustPackage rec {
12 pname = "bottom";
13 version = "0.10.2";
14
15 src = fetchFromGitHub {
16 owner = "ClementTsang";
17 repo = "bottom";
18 tag = version;
19 hash = "sha256-hm0Xfd/iW+431HflvZErjzeZtSdXVb/ReoNIeETJ5Ik=";
20 };
21
22 cargoHash = "sha256-feMgkCP6e3HsOppTYLtVrRn/vbSLLRKV0hp85gqr4qM=";
23
24 nativeBuildInputs = [
25 autoAddDriverRunpath
26 installShellFiles
27 ];
28
29 postInstall = ''
30 installManPage target/tmp/bottom/manpage/btm.1
31 installShellCompletion \
32 target/tmp/bottom/completion/btm.{bash,fish} \
33 --zsh target/tmp/bottom/completion/_btm
34
35 install -Dm444 desktop/bottom.desktop -t $out/share/applications
36 '';
37
38 preCheck = ''
39 HOME=$(mktemp -d)
40 '';
41
42 doInstallCheck = true;
43 nativeInstallCheckInputs = [
44 versionCheckHook
45 ];
46 versionCheckProgram = "${placeholder "out"}/bin/btm";
47
48 BTM_GENERATE = true;
49
50 passthru = {
51 updateScript = nix-update-script { };
52 };
53
54 meta = {
55 changelog = "https://github.com/ClementTsang/bottom/blob/${version}/CHANGELOG.md";
56 description = "Cross-platform graphical process/system monitor with a customizable interface";
57 homepage = "https://github.com/ClementTsang/bottom";
58 license = lib.licenses.mit;
59 mainProgram = "btm";
60 maintainers = with lib.maintainers; [
61 berbiche
62 figsoda
63 gepbird
64 ];
65 };
66}