2020-08-12 20:19:12 +02:00
|
|
|
{ stdenv, lib, buildGoPackage, fetchFromGitHub, makeWrapper, systemd }:
|
2019-03-01 08:18:57 +01:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2020-09-05 01:50:38 +02:00
|
|
|
version = "1.6.1";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "grafana-loki";
|
2019-03-01 08:18:57 +01:00
|
|
|
goPackagePath = "github.com/grafana/loki";
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "grafana";
|
|
|
|
repo = "loki";
|
2020-09-05 01:50:38 +02:00
|
|
|
sha256 = "0bakskzizazc5cd6km3n6facc5val5567zinnxg3yjy29xdi64ww";
|
2019-03-01 08:18:57 +01:00
|
|
|
};
|
|
|
|
|
2020-01-22 23:38:54 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pkg/distributor/distributor_test.go --replace \
|
|
|
|
'"eth0", "en0", "lo0"' \
|
|
|
|
'"lo"'
|
|
|
|
'';
|
|
|
|
|
2019-08-03 00:19:14 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2019-12-15 04:22:22 +01:00
|
|
|
buildInputs = stdenv.lib.optionals stdenv.isLinux [ systemd.dev ];
|
2019-08-03 00:19:14 +02:00
|
|
|
|
2019-12-15 04:22:22 +01:00
|
|
|
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
|
2020-04-28 03:50:57 +02:00
|
|
|
wrapProgram $out/bin/promtail \
|
2020-08-12 20:19:12 +02:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib"
|
2019-08-03 00:19:14 +02:00
|
|
|
'';
|
|
|
|
|
2019-03-01 08:18:57 +01:00
|
|
|
meta = with stdenv.lib; {
|
2019-11-21 13:18:43 +01:00
|
|
|
description = "Like Prometheus, but for logs";
|
2019-03-01 08:18:57 +01:00
|
|
|
license = licenses.asl20;
|
2019-12-15 04:22:22 +01:00
|
|
|
homepage = "https://grafana.com/oss/loki/";
|
2019-11-21 13:18:43 +01:00
|
|
|
maintainers = with maintainers; [ willibutz globin mmahut ];
|
2019-12-15 04:22:22 +01:00
|
|
|
platforms = platforms.unix;
|
2019-03-01 08:18:57 +01:00
|
|
|
};
|
|
|
|
}
|