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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.4 KiB
Nix
Raw Normal View History

2021-04-06 01:31:10 +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
buildGoModule rec {
version = "2.9.1";
pname = "grafana-loki";
2019-03-01 07:18:57 +00:00
src = fetchFromGitHub {
owner = "grafana";
repo = "loki";
rev = "v${version}";
hash = "sha256-hfX1srlAd8huLViHlEyk3mcfMhY/LmeryQtAhB7rafw=";
2019-03-01 07:18:57 +00:00
};
vendorHash = null;
subPackages = [
# TODO split every executable into its own package
"cmd/loki"
"cmd/loki-canary"
"clients/cmd/promtail"
"cmd/logcli"
];
2023-04-13 09:47:08 +00:00
tags = ["promtail_journal_enabled"];
2019-08-02 22:19:14 +00:00
nativeBuildInputs = [ makeWrapper ];
2021-01-15 07:07:56 +00:00
buildInputs = lib.optionals stdenv.isLinux [ systemd.dev ];
2019-08-02 22:19:14 +00:00
2021-01-15 07:07:56 +00:00
preFixup = lib.optionalString stdenv.isLinux ''
wrapProgram $out/bin/promtail \
--prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib"
2019-08-02 22:19:14 +00:00
'';
2020-11-10 09:46:30 +00:00
passthru.tests = { inherit (nixosTests) loki; };
ldflags = let t = "github.com/grafana/loki/pkg/util/build"; in [
"-s"
"-w"
"-X ${t}.Version=${version}"
"-X ${t}.BuildUser=nix@nixpkgs"
"-X ${t}.BuildDate=unknown"
"-X ${t}.Branch=unknown"
"-X ${t}.Revision=unknown"
];
meta = with lib; {
description = "Like Prometheus, but for logs";
license = with licenses; [ agpl3Only asl20 ];
2019-12-15 03:22:22 +00:00
homepage = "https://grafana.com/oss/loki/";
changelog = "https://github.com/grafana/loki/releases/tag/v${version}";
maintainers = with maintainers; [ willibutz globin mmahut emilylange ajs124 ];
2019-03-01 07:18:57 +00:00
};
}