nixpkgs/pkgs/by-name/gr/grafana-reporter/package.nix
Moritz Sanft 1ddd2fa945
grafana-reporter: migrate to buildGoModule
Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
2024-06-09 21:50:26 +02:00

42 lines
919 B
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, tetex
, makeWrapper
}:
buildGoModule rec {
pname = "reporter";
version = "2.3.1";
src = fetchFromGitHub {
rev = "v${version}";
owner = "IzakMarais";
repo = "reporter";
sha256 = "sha256-lsraJwx56I2Gn8CePWUlQu1qdMp78P4xwPzLxetYUcw=";
};
nativeBuildInputs = [ makeWrapper ];
vendorHash = null;
postPatch = ''
go mod init github.com/IzakMarais/reporter
'';
postInstall = ''
wrapProgram $out/bin/grafana-reporter \
--prefix PATH : ${lib.makeBinPath [ tetex ]}
'';
# Testing library used had a breaking API change and upstream didn't adapt.
doCheck = false;
meta = {
description = "PDF report generator from a Grafana dashboard";
mainProgram = "grafana-reporter";
homepage = "https://github.com/IzakMarais/reporter";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.disassembler ];
};
}