4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
38 lines
959 B
Nix
38 lines
959 B
Nix
{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, nixosTests, systemd
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
version = "2.1.0";
|
|
pname = "grafana-loki";
|
|
|
|
src = fetchFromGitHub {
|
|
rev = "v${version}";
|
|
owner = "grafana";
|
|
repo = "loki";
|
|
sha256 = "O/3079a67j1i9pgf18SBx0iJcQPVmb0H+K/PzQVBCDQ=";
|
|
};
|
|
|
|
vendorSha256 = null;
|
|
|
|
subPackages = [ "..." ];
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
buildInputs = stdenv.lib.optionals stdenv.isLinux [ systemd.dev ];
|
|
|
|
preFixup = stdenv.lib.optionalString stdenv.isLinux ''
|
|
wrapProgram $out/bin/promtail \
|
|
--prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib"
|
|
'';
|
|
|
|
passthru.tests = { inherit (nixosTests) loki; };
|
|
|
|
doCheck = true;
|
|
|
|
meta = with 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;
|
|
};
|
|
}
|