14 pname = "grafana-loki";
16 src = fetchFromGitHub {
20 hash = "sha256-2+OST6bKIjuhrXJKA+8vUERKT1/min7tN8oFxKn3L74=";
26 # TODO split every executable into its own package
29 "clients/cmd/promtail"
33 tags = ["promtail_journal_enabled"];
35 nativeBuildInputs = [ makeWrapper ];
36 buildInputs = lib.optionals stdenv.isLinux [ systemd.dev ];
38 preFixup = lib.optionalString stdenv.isLinux ''
39 wrapProgram $out/bin/promtail \
40 --prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib"
44 inherit (nixosTests) loki;
45 version = testers.testVersion {
46 command = "loki --version";
47 package = grafana-loki;
51 ldflags = let t = "github.com/grafana/loki/v3/pkg/util/build"; in [
54 "-X ${t}.Version=${version}"
55 "-X ${t}.BuildUser=nix@nixpkgs"
56 "-X ${t}.BuildDate=unknown"
57 "-X ${t}.Branch=unknown"
58 "-X ${t}.Revision=unknown"
62 description = "Like Prometheus, but for logs";
63 mainProgram = "promtail";
64 license = with licenses; [ agpl3Only asl20 ];
65 homepage = "https://grafana.com/oss/loki/";
66 changelog = "https://github.com/grafana/loki/releases/tag/v${version}";
67 maintainers = with maintainers; [ willibutz globin mmahut emilylange ] ++ teams.helsinki-systems.members;