2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, IOKit
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "gotop";
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "4.2.0";
|
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xxxserxxx";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-10-21 18:38:19 +00:00
|
|
|
hash = "sha256-W7a3QnSIR95N88RqU2sr6oEDSqOXVfAwacPvS219+1Y=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
proxyVendor = true;
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-KLeVSrPDS1lKsKFemRmgxT6Pxack3X3B/btSCOUSUFY=";
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2021-07-24 12:14:16 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X main.Version=v${version}" ];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
# prevent `error: 'TARGET_OS_MAC' is not defined`
|
|
|
|
env.CGO_CFLAGS = "-Wno-undef-prefix";
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ IOKit ];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
postInstall = ''
|
|
|
|
$out/bin/gotop --create-manpage > gotop.1
|
|
|
|
installManPage gotop.1
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Terminal based graphical activity monitor inspired by gtop and vtop";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/xxxserxxx/gotop";
|
2021-07-24 12:14:16 +00:00
|
|
|
changelog = "https://github.com/xxxserxxx/gotop/raw/v${version}/CHANGELOG.md";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.mit;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.magnetophon ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "gotop";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|