15 stdenv.mkDerivation (finalAttrs: {
19 src = fetchFromGitHub {
22 rev = "v${finalAttrs.version}";
23 hash = "sha256-bRgRpCnMt20JEuKqW5VetW8HyMgjNuqEgoeBG7sm++Y=";
26 # optional only to avoid linux rebuild
27 patches = lib.optionals stdenv.isDarwin [ ./macos-11-sdk-compat.patch ];
41 ++ lib.optionals stdenv.isLinux [ systemd ]
42 ++ lib.optionals stdenv.isDarwin [
43 darwin.apple_sdk_11_0.frameworks.IOKit
44 darwin.apple_sdk_11_0.frameworks.Foundation
50 "-DFLB_HTTP_SERVER=ON"
52 ] ++ lib.optionals stdenv.isDarwin [ "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13" ];
54 env.NIX_CFLAGS_COMPILE = toString (
55 # Used by the embedded luajit, but is not predefined on older mac SDKs.
56 lib.optionals stdenv.isDarwin [ "-DTARGET_OS_IPHONE=0" ]
57 # Assumes GNU version of strerror_r, and the posix version has an
58 # incompatible return type.
59 ++ lib.optionals (!stdenv.hostPlatform.isGnu) [ "-Wno-int-conversion" ]
68 substituteInPlace src/CMakeLists.txt \
69 --replace /lib/systemd $out/lib/systemd
73 changelog = "https://github.com/fluent/fluent-bit/releases/tag/v${finalAttrs.version}";
74 description = "Log forwarder and processor, part of Fluentd ecosystem";
75 homepage = "https://fluentbit.io";
76 license = lib.licenses.asl20;
77 maintainers = with lib.maintainers; [
81 platforms = lib.platforms.unix;