Files
nixpkgs/pkgs/by-name/bo/bottom/package.nix
2026-08-31 07:15:32 +00:00

73 lines
1.8 KiB
Nix

{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
autoAddDriverRunpath,
installShellFiles,
writableTmpDirAsHomeHook,
versionCheckHook,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "bottom";
version = "0.14.9";
src = fetchFromGitHub {
owner = "ClementTsang";
repo = "bottom";
tag = finalAttrs.version;
hash = "sha256-Dvo3A8NIYp0URgYSJOxLW/zEA7Gnpqu9pk6hvpagFZE=";
};
cargoHash = "sha256-PYbmqiE8G+or1NEtPxnWIXcHnKIBSjQ3FN/Zafb/BTw=";
nativeBuildInputs = [
autoAddDriverRunpath
installShellFiles
];
env = {
BTM_GENERATE = true;
};
postInstall = ''
installManPage target/tmp/bottom/manpage/btm.1
installShellCompletion \
target/tmp/bottom/completion/btm.{bash,fish} \
--zsh target/tmp/bottom/completion/_btm
install -Dm444 desktop/bottom.desktop -t $out/share/applications
install -Dm644 assets/icons/bottom-system-monitor.svg -t $out/share/icons/hicolor/scalable/apps
'';
checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [
# fails to get list of processes due to sandboxing, this functionality works at runtime
"--skip=collection::tests::test_data_collection"
];
doInstallCheck = true;
nativeInstallCheckInputs = [
versionCheckHook
writableTmpDirAsHomeHook
];
versionCheckProgram = "${placeholder "out"}/bin/btm";
passthru = {
updateScript = nix-update-script { };
};
meta = {
changelog = "https://github.com/ClementTsang/bottom/blob/${finalAttrs.version}/CHANGELOG.md";
description = "Cross-platform graphical process/system monitor with a customizable interface";
homepage = "https://github.com/ClementTsang/bottom";
license = lib.licenses.mit;
mainProgram = "btm";
maintainers = with lib.maintainers; [
berbiche
gepbird
];
};
})