From 2dc8f268eedcd57135ad341b00c43924eef5600a Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sun, 16 Nov 2025 17:25:55 +0100 Subject: [PATCH 1/2] bottom: use `finalAttrs` pattern --- pkgs/by-name/bo/bottom/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/bo/bottom/package.nix b/pkgs/by-name/bo/bottom/package.nix index 9afdac3ebfdf..0fec463ee282 100644 --- a/pkgs/by-name/bo/bottom/package.nix +++ b/pkgs/by-name/bo/bottom/package.nix @@ -8,14 +8,14 @@ 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="; }; @@ -52,7 +52,7 @@ rustPlatform.buildRustPackage rec { }; 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 +62,4 @@ rustPlatform.buildRustPackage rec { gepbird ]; }; -} +}) From ed3a52e41ffd69758344093c4da445e797ef2c1a Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sun, 16 Nov 2025 17:26:47 +0100 Subject: [PATCH 2/2] bottom: use `writableTmpDirAsHomeHook` --- pkgs/by-name/bo/bottom/package.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/bo/bottom/package.nix b/pkgs/by-name/bo/bottom/package.nix index 0fec463ee282..b649db34aa16 100644 --- a/pkgs/by-name/bo/bottom/package.nix +++ b/pkgs/by-name/bo/bottom/package.nix @@ -4,6 +4,7 @@ fetchFromGitHub, autoAddDriverRunpath, installShellFiles, + writableTmpDirAsHomeHook, versionCheckHook, nix-update-script, }: @@ -26,6 +27,10 @@ rustPlatform.buildRustPackage (finalAttrs: { installShellFiles ]; + env = { + BTM_GENERATE = true; + }; + postInstall = '' installManPage target/tmp/bottom/manpage/btm.1 installShellCompletion \ @@ -35,17 +40,13 @@ rustPlatform.buildRustPackage (finalAttrs: { 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 { };