grafana-reporter: migrate to buildGoModule

Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
This commit is contained in:
Moritz Sanft 2024-06-09 21:50:26 +02:00
parent bff605542a
commit 1ddd2fa945
No known key found for this signature in database
GPG Key ID: 335D28368B1DA615
4 changed files with 24 additions and 17 deletions

View File

@ -60,7 +60,7 @@ in {
"-templates ${cfg.templateDir}"
];
in {
ExecStart = "${pkgs.grafana_reporter}/bin/grafana-reporter ${args}";
ExecStart = "${pkgs.grafana-reporter}/bin/grafana-reporter ${args}";
};
};
};

View File

@ -1,33 +1,41 @@
{ lib, buildGoPackage, fetchFromGitHub, tetex, makeWrapper }:
with lib;
buildGoPackage rec {
{ lib
, buildGoModule
, fetchFromGitHub
, tetex
, makeWrapper
}:
buildGoModule rec {
pname = "reporter";
version = "2.3.1";
rev = "v${version}";
goPackagePath = "github.com/IzakMarais/reporter";
nativeBuildInputs = [ makeWrapper ];
src = fetchFromGitHub {
inherit rev;
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 : ${makeBinPath [ tetex ]}
--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 = licenses.mit;
maintainers = with maintainers; [ disassembler ];
license = lib.licenses.mit;
maintainers = [ lib.maintainers.disassembler ];
};
}

View File

@ -512,6 +512,7 @@ mapAliases ({
grab-site = throw "grab-site has been removed because it's unmaintained and broken"; # Added 2023-11-12
gradle_4 = throw "gradle_4 has been removed because it's no longer being updated"; # Added 2023-01-17
gradle_5 = throw "gradle_5 has been removed because it's no longer being updated"; # Added 2023-01-17
grafana_reporter = grafana-reporter; # Added 2024-06-09
gr-ais = throw "'gr-ais' has been renamed to/replaced by 'gnuradio3_7.pkgs.ais'"; # Converted to throw 2023-09-10
graylog = throw "graylog is now available in versions 3.3 up to 5.0. Please mind the upgrade path and choose the appropriate version. Direct upgrading from 3.3 to 4.3 or above is not supported"; # Added 2023-04-24
graylog-3_3 = throw "graylog 3.x is EOL. Please consider downgrading nixpkgs if you need an upgrade from 3.x to latest series."; # Added 2023-10-09

View File

@ -25674,8 +25674,6 @@ with pkgs;
phlare = callPackage ../servers/monitoring/phlare { };
grafana_reporter = callPackage ../servers/monitoring/grafana-reporter { };
grafana-image-renderer = callPackage ../servers/monitoring/grafana-image-renderer { };
grafana-dash-n-grab = callPackage ../servers/monitoring/grafana-dash-n-grab { };