1 { lib, stdenv, fetchFromGitHub, cmake, flex, bison, pkg-config
2 , systemd, openssl, postgresql }:
4 stdenv.mkDerivation rec {
8 src = fetchFromGitHub {
12 sha256 = "004x135imja67babmmpkk1jpp5xwhfa8cwg1svaas2asq6cnv77d";
15 nativeBuildInputs = [ cmake flex bison pkg-config postgresql ];
17 buildInputs = [ openssl ]
18 ++ lib.optionals stdenv.isLinux [ systemd ];
20 cmakeFlags = [ "-DFLB_METRICS=ON" "-DFLB_HTTP_SERVER=ON" "-DFLB_SQLDB=ON" "-DFLB_OUT_PGSQL=ON" "-DFLB_IN_SYSTEMD=ON" ];
22 patches = lib.optionals stdenv.isDarwin [ ./fix-luajit-darwin.patch ];
24 NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
25 # _FORTIFY_SOURCE requires compiling with optimization (-O)
27 # Needed due to bundled mbedtls
29 "-Wno-error=format-truncation"
33 outputs = [ "out" "dev" ];
36 substituteInPlace src/CMakeLists.txt \
37 --replace /lib/systemd $out/lib/systemd
41 description = "Log forwarder and processor, part of Fluentd ecosystem";
42 homepage = "https://fluentbit.io";
43 maintainers = with maintainers; [ samrose fpletz ];
44 license = licenses.asl20;
45 platforms = platforms.unix;