nixpkgs/pkgs/servers/monitoring/grafana/default.nix

42 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchurl, fetchFromGitHub }:
2015-11-16 05:28:03 -08:00
buildGoModule rec {
pname = "grafana";
2020-06-03 11:54:09 -07:00
version = "7.0.3";
2015-11-16 05:28:03 -08:00
2019-02-26 11:30:02 -08:00
excludedPackages = [ "release_publisher" ];
2015-11-16 05:28:03 -08:00
src = fetchFromGitHub {
rev = "v${version}";
owner = "grafana";
repo = "grafana";
2020-06-03 11:54:09 -07:00
sha256 = "1s5hq7icfnaiq7msk7vdz30wdhw13s115vg8ws7gqv5sl1hi0vlg";
2015-11-16 05:28:03 -08:00
};
srcStatic = fetchurl {
url = "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz";
2020-06-03 11:54:09 -07:00
sha256 = "1wk991nvm6a18mah37dh0sdi72gdshpzdi367v7fpz2b9vd65b4g";
2015-11-16 05:28:03 -08:00
};
vendorSha256 = "00xvpxhnvxdf030978paywl794mlmgqzd94b64hh67946acnbjcl";
postPatch = ''
substituteInPlace pkg/cmd/grafana-server/main.go \
--replace 'var version = "5.0.0"' 'var version = "${version}"'
'';
2015-11-16 05:28:03 -08:00
postInstall = ''
tar -xvf $srcStatic
mkdir -p $out/share/grafana
mv grafana-*/{public,conf,tools} $out/share/grafana/
2015-11-16 05:28:03 -08:00
'';
meta = with lib; {
description = "Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB";
license = licenses.asl20;
2019-08-15 05:30:23 -07:00
homepage = "https://grafana.com";
2020-03-21 12:23:26 -07:00
maintainers = with maintainers; [ offline fpletz willibutz globin ma27 Frostman ];
platforms = platforms.linux;
2015-11-16 05:28:03 -08:00
};
}