1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 installShellFiles,
6 writableTmpDirAsHomeHook,
7}:
8
9buildGoModule (finalAttrs: {
10 pname = "gotop";
11 version = "4.2.0";
12
13 outputs = [
14 "out"
15 "man"
16 ];
17
18 src = fetchFromGitHub {
19 owner = "xxxserxxx";
20 repo = "gotop";
21 rev = "v${finalAttrs.version}";
22 hash = "sha256-W7a3QnSIR95N88RqU2sr6oEDSqOXVfAwacPvS219+1Y=";
23 };
24
25 proxyVendor = true;
26 vendorHash = "sha256-KLeVSrPDS1lKsKFemRmgxT6Pxack3X3B/btSCOUSUFY=";
27
28 ldflags = [
29 "-s"
30 "-w"
31 "-X main.Version=v${finalAttrs.version}"
32 ];
33
34 nativeBuildInputs = [ installShellFiles ];
35 nativeCheckInputs = [ writableTmpDirAsHomeHook ];
36
37 postInstall = ''
38 $out/bin/gotop --create-manpage > gotop.1
39 installManPage gotop.1
40 '';
41
42 meta = {
43 description = "Terminal based graphical activity monitor inspired by gtop and vtop";
44 homepage = "https://github.com/xxxserxxx/gotop";
45 changelog = "https://github.com/xxxserxxx/gotop/raw/v${finalAttrs.version}/CHANGELOG.md";
46 license = lib.licenses.mit;
47 maintainers = [ lib.maintainers.magnetophon ];
48 mainProgram = "gotop";
49 };
50})