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