nixpkgs/pkgs/servers/monitoring/loki/default.nix

39 lines
1.0 KiB
Nix
Raw Normal View History

2019-08-02 22:19:14 +00:00
{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper, systemd }:
2019-03-01 07:18:57 +00:00
buildGoPackage rec {
version = "1.3.0";
pname = "grafana-loki";
2019-03-01 07:18:57 +00:00
goPackagePath = "github.com/grafana/loki";
doCheck = true;
src = fetchFromGitHub {
rev = "v${version}";
owner = "grafana";
repo = "loki";
sha256 = "0b1dpb3vh5i18467qk8kpb5ic14p4p1dfyr8hjkznf6bs7g8ka1q";
2019-03-01 07:18:57 +00:00
};
postPatch = ''
substituteInPlace pkg/distributor/distributor_test.go --replace \
'"eth0", "en0", "lo0"' \
'"lo"'
'';
2019-08-02 22:19:14 +00:00
nativeBuildInputs = [ makeWrapper ];
2019-12-15 03:22:22 +00:00
buildInputs = stdenv.lib.optionals stdenv.isLinux [ systemd.dev ];
2019-08-02 22:19:14 +00:00
2019-12-15 03:22:22 +00:00
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
2019-08-02 22:19:14 +00:00
wrapProgram $bin/bin/promtail \
--prefix LD_LIBRARY_PATH : "${systemd.lib}/lib"
'';
2019-03-01 07:18:57 +00:00
meta = with stdenv.lib; {
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/";
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
};
}