diff --git a/pkgs/by-name/bo/bottom/package.nix b/pkgs/by-name/bo/bottom/package.nix index 9afdac3ebfdf..b649db34aa16 100644 --- a/pkgs/by-name/bo/bottom/package.nix +++ b/pkgs/by-name/bo/bottom/package.nix @@ -4,18 +4,19 @@ fetchFromGitHub, autoAddDriverRunpath, installShellFiles, + writableTmpDirAsHomeHook, versionCheckHook, nix-update-script, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "bottom"; version = "0.11.3"; src = fetchFromGitHub { owner = "ClementTsang"; repo = "bottom"; - tag = version; + tag = finalAttrs.version; hash = "sha256-7rVvKAqK8hqICnSr/Ax9ndsIZAdTaUyOAoVZ13W5BJs="; }; @@ -26,6 +27,10 @@ rustPlatform.buildRustPackage rec { installShellFiles ]; + env = { + BTM_GENERATE = true; + }; + postInstall = '' installManPage target/tmp/bottom/manpage/btm.1 installShellCompletion \ @@ -35,24 +40,20 @@ rustPlatform.buildRustPackage rec { install -Dm444 desktop/bottom.desktop -t $out/share/applications ''; - preCheck = '' - HOME=$(mktemp -d) - ''; - doInstallCheck = true; nativeInstallCheckInputs = [ versionCheckHook + writableTmpDirAsHomeHook ]; versionCheckProgram = "${placeholder "out"}/bin/btm"; - - BTM_GENERATE = true; + versionCheckProgramArg = "--version"; passthru = { updateScript = nix-update-script { }; }; meta = { - changelog = "https://github.com/ClementTsang/bottom/blob/${version}/CHANGELOG.md"; + 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; @@ -62,4 +63,4 @@ rustPlatform.buildRustPackage rec { gepbird ]; }; -} +})