50 lines
1.4 KiB
Nix
50 lines
1.4 KiB
Nix
{ lib, buildGoModule, fetchurl, fetchFromGitHub, nixosTests }:
|
|
|
|
buildGoModule rec {
|
|
pname = "grafana";
|
|
version = "7.3.3";
|
|
|
|
excludedPackages = [ "release_publisher" ];
|
|
|
|
src = fetchFromGitHub {
|
|
rev = "v${version}";
|
|
owner = "grafana";
|
|
repo = "grafana";
|
|
sha256 = "1891whg244s1lj8lm3sxsxaimjb1yr1n4v7kgjjz7hi9fkscswbw";
|
|
};
|
|
|
|
srcStatic = fetchurl {
|
|
url = "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz";
|
|
sha256 = "0ybzlnaq7j1v6valyb997wiydpbsgb2ycb8r92wyb901hd4frj7h";
|
|
};
|
|
|
|
vendorSha256 = "09rb96fm7ij16r843lbwcxb26vmjyahs1bi5pnnqz0mnm0vvmsjb";
|
|
|
|
postPatch = ''
|
|
substituteInPlace pkg/cmd/grafana-server/main.go \
|
|
--replace 'var version = "5.0.0"' 'var version = "${version}"'
|
|
'';
|
|
|
|
# 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
|
|
'';
|
|
|
|
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;
|
|
};
|
|
}
|