
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.
42 lines
1.1 KiB
Nix
42 lines
1.1 KiB
Nix
{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, iproute2, nettools }:
|
|
|
|
buildGoModule rec {
|
|
pname = "mackerel-agent";
|
|
version = "0.82.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "mackerelio";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-zkwYYkI7oeOdJH/K9E8/ZkTOexEKyP1I2kOJlt7PcK4=";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
nativeCheckInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ nettools ];
|
|
buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ iproute2 ];
|
|
|
|
vendorHash = "sha256-JIqQXS2iw3opeotpfqC16w7hdu+7XjxhIyVj2M+98ec=";
|
|
|
|
subPackages = [ "." ];
|
|
|
|
ldflags = [
|
|
"-X=main.version=${version}"
|
|
"-X=main.gitcommit=v${version}"
|
|
];
|
|
|
|
postInstall = ''
|
|
wrapProgram $out/bin/mackerel-agent \
|
|
--prefix PATH : "${lib.makeBinPath buildInputs}"
|
|
'';
|
|
|
|
doCheck = true;
|
|
|
|
meta = with lib; {
|
|
description = "System monitoring service for mackerel.io";
|
|
mainProgram = "mackerel-agent";
|
|
homepage = "https://github.com/mackerelio/mackerel-agent";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ midchildan ];
|
|
};
|
|
}
|