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