Files
nixpkgs/pkgs/by-name/bt/btop/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

75 lines
1.8 KiB
Nix

{
lib,
config,
stdenv,
fetchFromGitHub,
cmake,
removeReferencesTo,
autoAddDriverRunpath,
apple-sdk_15,
versionCheckHook,
nix-update-script,
rocmPackages,
cudaSupport ? config.cudaSupport,
rocmSupport ? config.rocmSupport,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "btop";
version = "1.4.5";
src = fetchFromGitHub {
owner = "aristocratos";
repo = "btop";
tag = "v${finalAttrs.version}";
hash = "sha256-ZLT+Hc1rvBFyhey+imbgGzSH/QaVxIh/jvDKVSmDrA0=";
};
nativeBuildInputs = [
cmake
]
++ lib.optionals cudaSupport [
autoAddDriverRunpath
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_15
];
installFlags = [ "PREFIX=$(out)" ];
# fix build on darwin (see https://github.com/NixOS/nixpkgs/pull/422218#issuecomment-3039181870 and https://github.com/aristocratos/btop/pull/1173)
cmakeFlags = [
(lib.cmakeBool "BTOP_LTO" (!stdenv.hostPlatform.isDarwin))
];
postInstall = ''
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/bin/btop)
'';
postPhases = lib.optionals rocmSupport [ "postPatchelf" ];
postPatchelf = lib.optionalString rocmSupport ''
patchelf --add-rpath ${lib.getLib rocmPackages.rocm-smi}/lib $out/bin/btop
'';
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru.updateScript = nix-update-script { };
meta = {
description = "Monitor of resources";
homepage = "https://github.com/aristocratos/btop";
changelog = "https://github.com/aristocratos/btop/blob/v${finalAttrs.version}/CHANGELOG.md";
license = lib.licenses.asl20;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = with lib.maintainers; [
khaneliman
rmcgibbo
ryan4yin
];
mainProgram = "btop";
};
})