2020-08-20 09:00:54 +01:00
|
|
|
{ lib, buildGoModule, fetchurl, fetchFromGitHub, nixosTests }:
|
2015-11-16 13:28:03 +00:00
|
|
|
|
2020-05-23 01:04:18 +01:00
|
|
|
buildGoModule rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "grafana";
|
2020-12-10 13:26:58 +00:00
|
|
|
version = "7.3.5";
|
2015-11-16 13:28:03 +00:00
|
|
|
|
2019-02-26 19:30:02 +00:00
|
|
|
excludedPackages = [ "release_publisher" ];
|
|
|
|
|
2015-11-16 13:28:03 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "grafana";
|
|
|
|
repo = "grafana";
|
2020-12-10 13:26:58 +00:00
|
|
|
sha256 = "1gxa1j7sd4xcyb2gh2ja6mwp0j4zcqwzaz25n9f9p9azhjyd2zh5";
|
2015-11-16 13:28:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
srcStatic = fetchurl {
|
2019-08-29 16:16:47 +01:00
|
|
|
url = "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz";
|
2020-12-10 13:26:58 +00:00
|
|
|
sha256 = "0vplzj5jrx643qp68kxg1g1gazxjrnx771dmc1703zalv28z8fq3";
|
2015-11-16 13:28:03 +00:00
|
|
|
};
|
|
|
|
|
2020-12-10 13:26:58 +00:00
|
|
|
vendorSha256 = "05brpjac54a8bxh7psy8gix9q2g36fr4z5msahp6i8wv2xfrf98b";
|
2020-08-04 01:26:27 +01:00
|
|
|
|
2018-06-27 16:18:49 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pkg/cmd/grafana-server/main.go \
|
|
|
|
--replace 'var version = "5.0.0"' 'var version = "${version}"'
|
|
|
|
'';
|
|
|
|
|
2020-09-26 23:34:59 +01:00
|
|
|
# fixes build failure with go 1.15:
|
|
|
|
# main module (github.com/grafana/grafana) does not contain package github.com/grafana/grafana/scripts/go
|
|
|
|
preBuild = ''
|
|
|
|
rm -rf scripts/go
|
|
|
|
'';
|
|
|
|
|
2015-11-16 13:28:03 +00:00
|
|
|
postInstall = ''
|
|
|
|
tar -xvf $srcStatic
|
2020-04-28 02:50:57 +01:00
|
|
|
mkdir -p $out/share/grafana
|
|
|
|
mv grafana-*/{public,conf,tools} $out/share/grafana/
|
2015-11-16 13:28:03 +00:00
|
|
|
'';
|
|
|
|
|
2020-08-20 09:00:54 +01:00
|
|
|
passthru.tests = { inherit (nixosTests) grafana; };
|
|
|
|
|
2015-11-16 13:28:03 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB";
|
|
|
|
license = licenses.asl20;
|
2019-08-15 13:30:23 +01:00
|
|
|
homepage = "https://grafana.com";
|
2020-03-21 19:23:26 +00:00
|
|
|
maintainers = with maintainers; [ offline fpletz willibutz globin ma27 Frostman ];
|
2015-11-18 10:33:50 +00:00
|
|
|
platforms = platforms.linux;
|
2015-11-16 13:28:03 +00:00
|
|
|
};
|
|
|
|
}
|