2020-12-29 15:07:52 +00:00
|
|
|
{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, nixosTests, systemd
|
2020-11-12 09:05:59 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
buildGoModule rec {
|
2020-12-29 15:07:52 +00:00
|
|
|
version = "2.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "grafana-loki";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "grafana";
|
|
|
|
repo = "loki";
|
2020-12-29 15:07:52 +00:00
|
|
|
sha256 = "O/3079a67j1i9pgf18SBx0iJcQPVmb0H+K/PzQVBCDQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
vendorSha256 = null;
|
|
|
|
|
|
|
|
subPackages = [ "..." ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2021-01-15 22:18:51 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isLinux [ systemd.dev ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
preFixup = lib.optionalString stdenv.isLinux ''
|
2020-05-15 21:57:56 +00:00
|
|
|
wrapProgram $out/bin/promtail \
|
2020-09-25 04:45:31 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2020-11-12 09:05:59 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) loki; };
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Like Prometheus, but for logs";
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "https://grafana.com/oss/loki/";
|
|
|
|
maintainers = with maintainers; [ willibutz globin mmahut ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|