From 630e1cd57e8c32d822dcbf5ae51dd5c1132ee43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Sat, 30 Nov 2024 21:43:25 +0100 Subject: [PATCH 1/9] bottom: migrate to new apple sdk --- pkgs/tools/system/bottom/default.nix | 4 ++-- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/system/bottom/default.nix b/pkgs/tools/system/bottom/default.nix index f042b7067f4ec..915f8f0d34653 100644 --- a/pkgs/tools/system/bottom/default.nix +++ b/pkgs/tools/system/bottom/default.nix @@ -4,7 +4,7 @@ fetchFromGitHub, installShellFiles, stdenv, - darwin, + apple-sdk_11, bottom, testers, }: @@ -25,7 +25,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ installShellFiles ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ - darwin.apple_sdk_11_0.frameworks.Foundation + apple-sdk_11 ]; doCheck = false; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f60fc1d210258..eed1f408efeee 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18810,7 +18810,7 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) CoreServices; }; - bottom = darwin.apple_sdk_11_0.callPackage ../tools/system/bottom { }; + bottom = callPackage ../tools/system/bottom { }; cagebreak = callPackage ../applications/window-managers/cagebreak { wlroots = wlroots_0_17; From f0feb1bb38a09a27dcf71394525119ba1c429078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Sat, 30 Nov 2024 21:46:47 +0100 Subject: [PATCH 2/9] bottom: migrate to by-name --- .../system/bottom/default.nix => by-name/bo/bottom/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{tools/system/bottom/default.nix => by-name/bo/bottom/package.nix} (100%) diff --git a/pkgs/tools/system/bottom/default.nix b/pkgs/by-name/bo/bottom/package.nix similarity index 100% rename from pkgs/tools/system/bottom/default.nix rename to pkgs/by-name/bo/bottom/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index eed1f408efeee..6394576ab6db0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18810,8 +18810,6 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) CoreServices; }; - bottom = callPackage ../tools/system/bottom { }; - cagebreak = callPackage ../applications/window-managers/cagebreak { wlroots = wlroots_0_17; }; From 537c6af0bb12cefac56701196206bc484c361cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Sat, 30 Nov 2024 21:28:38 +0100 Subject: [PATCH 3/9] bottom: add gpu driver recognition --- pkgs/by-name/bo/bottom/package.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/bo/bottom/package.nix b/pkgs/by-name/bo/bottom/package.nix index 915f8f0d34653..48266986baaab 100644 --- a/pkgs/by-name/bo/bottom/package.nix +++ b/pkgs/by-name/bo/bottom/package.nix @@ -2,6 +2,7 @@ lib, rustPlatform, fetchFromGitHub, + autoAddDriverRunpath, installShellFiles, stdenv, apple-sdk_11, @@ -22,7 +23,10 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-FQbJx6ijX8kE4qxT7OQ7FwxLKJB5/moTKhBK0bfvBas="; - nativeBuildInputs = [ installShellFiles ]; + nativeBuildInputs = [ + autoAddDriverRunpath + installShellFiles + ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_11 From d597f4d7f4d57e8b075522e6b7d6fa84bf68c8f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Sat, 30 Nov 2024 21:30:02 +0100 Subject: [PATCH 4/9] bottom: remove `with lib;`, order `meta` attrs --- pkgs/by-name/bo/bottom/package.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/bo/bottom/package.nix b/pkgs/by-name/bo/bottom/package.nix index 48266986baaab..95bdc0aff5216 100644 --- a/pkgs/by-name/bo/bottom/package.nix +++ b/pkgs/by-name/bo/bottom/package.nix @@ -49,15 +49,15 @@ rustPlatform.buildRustPackage rec { package = bottom; }; - meta = with lib; { + meta = { + changelog = "https://github.com/ClementTsang/bottom/blob/${version}/CHANGELOG.md"; description = "Cross-platform graphical process/system monitor with a customizable interface"; homepage = "https://github.com/ClementTsang/bottom"; - changelog = "https://github.com/ClementTsang/bottom/blob/${version}/CHANGELOG.md"; - license = licenses.mit; - maintainers = with maintainers; [ + license = lib.licenses.mit; + mainProgram = "btm"; + maintainers = with lib.maintainers; [ berbiche figsoda ]; - mainProgram = "btm"; }; } From 4f020a6956f4eabcff4d496ecc0957d08d6cd8c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Sat, 30 Nov 2024 21:49:02 +0100 Subject: [PATCH 5/9] bottom: `fetchFromGitHub` refactor --- pkgs/by-name/bo/bottom/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/bo/bottom/package.nix b/pkgs/by-name/bo/bottom/package.nix index 95bdc0aff5216..86329303ecf91 100644 --- a/pkgs/by-name/bo/bottom/package.nix +++ b/pkgs/by-name/bo/bottom/package.nix @@ -16,8 +16,8 @@ rustPlatform.buildRustPackage rec { src = fetchFromGitHub { owner = "ClementTsang"; - repo = pname; - rev = version; + repo = "bottom"; + tag = version; hash = "sha256-hm0Xfd/iW+431HflvZErjzeZtSdXVb/ReoNIeETJ5Ik="; }; From 614fdc5104f7f6f4834c6114128065d354756ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Sat, 30 Nov 2024 21:54:13 +0100 Subject: [PATCH 6/9] bottom: add update script --- pkgs/by-name/bo/bottom/package.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/bo/bottom/package.nix b/pkgs/by-name/bo/bottom/package.nix index 86329303ecf91..583cc57e37eee 100644 --- a/pkgs/by-name/bo/bottom/package.nix +++ b/pkgs/by-name/bo/bottom/package.nix @@ -7,6 +7,7 @@ stdenv, apple-sdk_11, bottom, + nix-update-script, testers, }: @@ -45,8 +46,11 @@ rustPlatform.buildRustPackage rec { BTM_GENERATE = true; - passthru.tests.version = testers.testVersion { - package = bottom; + passthru = { + updateScript = nix-update-script { }; + tests.version = testers.testVersion { + package = bottom; + }; }; meta = { From 56eb633cc2a9be91b71c3e9da7d41a1ca101133d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Sat, 30 Nov 2024 22:48:55 +0100 Subject: [PATCH 7/9] bottom: enable tests --- pkgs/by-name/bo/bottom/package.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/bo/bottom/package.nix b/pkgs/by-name/bo/bottom/package.nix index 583cc57e37eee..a91bdf3536828 100644 --- a/pkgs/by-name/bo/bottom/package.nix +++ b/pkgs/by-name/bo/bottom/package.nix @@ -33,8 +33,6 @@ rustPlatform.buildRustPackage rec { apple-sdk_11 ]; - doCheck = false; - postInstall = '' installManPage target/tmp/bottom/manpage/btm.1 installShellCompletion \ @@ -44,6 +42,10 @@ rustPlatform.buildRustPackage rec { install -Dm444 desktop/bottom.desktop -t $out/share/applications ''; + preCheck = '' + HOME=$(mktemp -d) + ''; + BTM_GENERATE = true; passthru = { From c2841d774b231b88a0e18b9073d08ef9ffd4566d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Sat, 30 Nov 2024 22:49:22 +0100 Subject: [PATCH 8/9] bottom: add maintainer gepbird --- pkgs/by-name/bo/bottom/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/bo/bottom/package.nix b/pkgs/by-name/bo/bottom/package.nix index a91bdf3536828..3fc07d6b24118 100644 --- a/pkgs/by-name/bo/bottom/package.nix +++ b/pkgs/by-name/bo/bottom/package.nix @@ -64,6 +64,7 @@ rustPlatform.buildRustPackage rec { maintainers = with lib.maintainers; [ berbiche figsoda + gepbird ]; }; } From cf269ecc0a04709d02ca6d568d6228feebb9ebd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Wed, 11 Dec 2024 09:41:56 +0100 Subject: [PATCH 9/9] bottom: move to versionCheckHook --- pkgs/by-name/bo/bottom/package.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/bo/bottom/package.nix b/pkgs/by-name/bo/bottom/package.nix index 3fc07d6b24118..33b91c6db5d23 100644 --- a/pkgs/by-name/bo/bottom/package.nix +++ b/pkgs/by-name/bo/bottom/package.nix @@ -6,9 +6,8 @@ installShellFiles, stdenv, apple-sdk_11, - bottom, + versionCheckHook, nix-update-script, - testers, }: rustPlatform.buildRustPackage rec { @@ -46,13 +45,16 @@ rustPlatform.buildRustPackage rec { HOME=$(mktemp -d) ''; + doInstallCheck = true; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgram = "${placeholder "out"}/bin/btm"; + BTM_GENERATE = true; passthru = { updateScript = nix-update-script { }; - tests.version = testers.testVersion { - package = bottom; - }; }; meta = {