nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 rustPlatform,
5 fetchFromGitHub,
6 autoAddDriverRunpath,
7 installShellFiles,
8 writableTmpDirAsHomeHook,
9 versionCheckHook,
10 nix-update-script,
11}:
12
13rustPlatform.buildRustPackage (finalAttrs: {
14 pname = "bottom";
15 version = "0.12.3";
16
17 src = fetchFromGitHub {
18 owner = "ClementTsang";
19 repo = "bottom";
20 tag = finalAttrs.version;
21 hash = "sha256-arbVp0UjapM8SQ99XQCP7c+iGInyuxxx6LMEONRVl6o=";
22 };
23
24 cargoHash = "sha256-miSMcqy4OFZFhAs9M+zdv4OzYgFxN2/uBo6V/kJql90=";
25
26 nativeBuildInputs = [
27 autoAddDriverRunpath
28 installShellFiles
29 ];
30
31 env = {
32 BTM_GENERATE = true;
33 };
34
35 postInstall = ''
36 installManPage target/tmp/bottom/manpage/btm.1
37 installShellCompletion \
38 target/tmp/bottom/completion/btm.{bash,fish} \
39 --zsh target/tmp/bottom/completion/_btm
40
41 install -Dm444 desktop/bottom.desktop -t $out/share/applications
42 install -Dm644 assets/icons/bottom-system-monitor.svg -t $out/share/icons/hicolor/scalable/apps
43 '';
44
45 checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [
46 # fails to get list of processes due to sandboxing, this functionality works at runtime
47 "--skip=collection::tests::test_data_collection"
48 ];
49
50 doInstallCheck = true;
51 nativeInstallCheckInputs = [
52 versionCheckHook
53 writableTmpDirAsHomeHook
54 ];
55 versionCheckProgram = "${placeholder "out"}/bin/btm";
56
57 passthru = {
58 updateScript = nix-update-script { };
59 };
60
61 meta = {
62 changelog = "https://github.com/ClementTsang/bottom/blob/${finalAttrs.version}/CHANGELOG.md";
63 description = "Cross-platform graphical process/system monitor with a customizable interface";
64 homepage = "https://github.com/ClementTsang/bottom";
65 license = lib.licenses.mit;
66 mainProgram = "btm";
67 maintainers = with lib.maintainers; [
68 berbiche
69 gepbird
70 ];
71 };
72})