nixpkgs/pkgs/by-name/go/gopsuinfo/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

43 lines
1.0 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
}:
buildGoModule rec {
pname = "gopsuinfo";
version = "0.1.5";
src = fetchFromGitHub {
owner = "nwg-piotr";
repo = "gopsuinfo";
rev = "v${version}";
sha256 = "sha256-h+CdiQh7IguCduIMCCI/UPIUAdXlNSHdkz6hrG10h3c=";
};
vendorHash = "sha256-S2ZHfrbEjPDweazwWbMbEMcMl/i+8Nru0G0e7RjOJMk=";
# Remove installing of binary from the Makefile (already taken care of by
# `buildGoModule`)
patches = [
./no_bin_install.patch
];
# Fix absolute path of icons in the code
postPatch = ''
substituteInPlace gopsuinfo.go \
--replace "/usr/share/gopsuinfo" "$out/usr/share/gopsuinfo"
'';
# Install icons
postInstall = ''make install DESTDIR=$out'';
meta = with lib; {
description = "Gopsutil-based command to display system usage info";
homepage = "https://github.com/nwg-piotr/gopsuinfo";
license = licenses.bsd2;
maintainers = with maintainers; [ otini ];
platforms = platforms.linux;
mainProgram = "gopsuinfo";
};
}