mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 14:41:17 +00:00
39 lines
1 KiB
Nix
39 lines
1 KiB
Nix
{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper, systemd }:
|
|
|
|
buildGoPackage rec {
|
|
version = "1.4.0";
|
|
pname = "grafana-loki";
|
|
goPackagePath = "github.com/grafana/loki";
|
|
|
|
doCheck = true;
|
|
|
|
src = fetchFromGitHub {
|
|
rev = "v${version}";
|
|
owner = "grafana";
|
|
repo = "loki";
|
|
sha256 = "0dz0icbkwpmysl5jyljmj783xdzrbbxbfxfkizw7gcs8jjxbqvfl";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace pkg/distributor/distributor_test.go --replace \
|
|
'"eth0", "en0", "lo0"' \
|
|
'"lo"'
|
|
'';
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
buildInputs = stdenv.lib.optionals stdenv.isLinux [ systemd.dev ];
|
|
|
|
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
|
|
wrapProgram $bin/bin/promtail \
|
|
--prefix LD_LIBRARY_PATH : "${systemd.lib}/lib"
|
|
'';
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "Like Prometheus, but for logs";
|
|
license = licenses.asl20;
|
|
homepage = "https://grafana.com/oss/loki/";
|
|
maintainers = with maintainers; [ willibutz globin mmahut ];
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|