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;
|
2022-10-21 18:38:19 +00:00
|
|
|
vendorSha256 = "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 ];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ IOKit ];
|
|
|
|
|
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; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A terminal based graphical activity monitor inspired by gtop and vtop";
|
|
|
|
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 ];
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
}
|