2020-10-28 17:13:01 -07:00
|
|
|
{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, systemd, fetchpatch }:
|
2019-02-28 23:18:57 -08:00
|
|
|
|
2020-10-28 17:13:01 -07:00
|
|
|
buildGoModule rec {
|
|
|
|
version = "2.0.0";
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "grafana-loki";
|
2019-02-28 23:18:57 -08:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "grafana";
|
|
|
|
repo = "loki";
|
2020-10-28 17:13:01 -07:00
|
|
|
sha256 = "09a0mqdmk754vigd1xqijzwazwrmfaqcgdr2c6dz25p7a65568hj";
|
2019-02-28 23:18:57 -08:00
|
|
|
};
|
|
|
|
|
2020-10-28 17:13:01 -07:00
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
|
|
subPackages = [ "..." ];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# Fix expected return value in Test_validateDropConfig
|
|
|
|
# https://github.com/grafana/loki/issues/2519
|
|
|
|
url = "https://github.com/grafana/loki/commit/1316c0f0c5cda7c272c4873ea910211476fc1db8.patch";
|
|
|
|
sha256 = "06hwga58qpmivbhyjgyqzb75602hy8212a4b5vh99y9pnn6c913h";
|
|
|
|
})
|
|
|
|
];
|
2020-01-22 14:38:54 -08:00
|
|
|
|
2019-08-02 15:19:14 -07:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2019-12-14 19:22:22 -08:00
|
|
|
buildInputs = stdenv.lib.optionals stdenv.isLinux [ systemd.dev ];
|
2019-08-02 15:19:14 -07:00
|
|
|
|
2019-12-14 19:22:22 -08:00
|
|
|
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
|
2020-04-27 18:50:57 -07:00
|
|
|
wrapProgram $out/bin/promtail \
|
2020-08-12 11:19:12 -07:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib"
|
2019-08-02 15:19:14 -07:00
|
|
|
'';
|
|
|
|
|
2020-10-28 17:13:01 -07:00
|
|
|
doCheck = true;
|
|
|
|
|
2019-02-28 23:18:57 -08:00
|
|
|
meta = with stdenv.lib; {
|
2019-11-21 04:18:43 -08:00
|
|
|
description = "Like Prometheus, but for logs";
|
2019-02-28 23:18:57 -08:00
|
|
|
license = licenses.asl20;
|
2019-12-14 19:22:22 -08:00
|
|
|
homepage = "https://grafana.com/oss/loki/";
|
2019-11-21 04:18:43 -08:00
|
|
|
maintainers = with maintainers; [ willibutz globin mmahut ];
|
2019-12-14 19:22:22 -08:00
|
|
|
platforms = platforms.unix;
|
2019-02-28 23:18:57 -08:00
|
|
|
};
|
|
|
|
}
|