44 lines
1.2 KiB
Nix
44 lines
1.2 KiB
Nix
{ lib, buildGoModule, fetchurl, fetchFromGitHub, nixosTests }:
|
|
|
|
buildGoModule rec {
|
|
pname = "grafana";
|
|
version = "7.1.3";
|
|
|
|
excludedPackages = [ "release_publisher" ];
|
|
|
|
src = fetchFromGitHub {
|
|
rev = "v${version}";
|
|
owner = "grafana";
|
|
repo = "grafana";
|
|
sha256 = "1acvvqsgwfrkqmbgzdxfa8shwmx7c91agaqv3gsfgpqkqwp3pnmh";
|
|
};
|
|
|
|
srcStatic = fetchurl {
|
|
url = "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz";
|
|
sha256 = "0c72xmazr3rgiccrqcy02w30159vsq9d78dkqf5c2yjqn8zzwf98";
|
|
};
|
|
|
|
vendorSha256 = "11zi7a4mqi80m5z4zcrc6wnzhgk6xnmzisrk2v4vpmfp33s732lz";
|
|
|
|
postPatch = ''
|
|
substituteInPlace pkg/cmd/grafana-server/main.go \
|
|
--replace 'var version = "5.0.0"' 'var version = "${version}"'
|
|
'';
|
|
|
|
postInstall = ''
|
|
tar -xvf $srcStatic
|
|
mkdir -p $out/share/grafana
|
|
mv grafana-*/{public,conf,tools} $out/share/grafana/
|
|
'';
|
|
|
|
passthru.tests = { inherit (nixosTests) grafana; };
|
|
|
|
meta = with lib; {
|
|
description = "Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB";
|
|
license = licenses.asl20;
|
|
homepage = "https://grafana.com";
|
|
maintainers = with maintainers; [ offline fpletz willibutz globin ma27 Frostman ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|