anchor.diff:        sha256 = libsSha256;
       }} libs
       chmod -R +w libs
  -    cmakeFlagsArray+=("-DFALCOSECURITY_LIBS_SOURCE_DIR=$(pwd)/libs")
  +    cmakeFlagsArray+=("-DFALCOSECURITY_LIBS_SOURCE_DIR=$(pwd)/libs" "-DVALIJSON_INCLUDE=${valijson}/include")
     '';
   
     cmakeFlags = [
  
positive.code:   NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg -DluaL_getn(L,i)=((int)lua_objlen(L,i))";
  
    preConfigure = ''
      cmakeFlagsArray+=(-DCMAKE_EXE_LINKER_FLAGS="-ltbb -lcurl -labsl_synchronization")
    '' + optionalString (kernel != null) ''
      export INSTALL_MOD_PATH="$out"
  
negative.code: { lib, stdenv, fetchFromGitHub, fetchpatch, cmake, kernel, installShellFiles, pkg-config
  , luajit, ncurses, perl, jsoncpp, libb64, openssl, curl, jq, gcc, elfutils, tbb, protobuf, grpc
  , libyamlcpp, nlohmann_json
  }:
  
  with lib;
  let
    # Compare with https://github.com/draios/sysdig/blob/dev/cmake/modules/falcosecurity-libs.cmake
    libsRev = "e5c53d648f3c4694385bbe488e7d47eaa36c229a";
    libsSha256 = "sha256-pG10y5PpDqaF/cq8oAvax5B/ls2UTRQd7tCfBjWVf0U=";
  
    # Compare with https://github.com/falcosecurity/libs/blob/master/cmake/modules/valijson.cmake#L17
    valijson = fetchFromGitHub {
      owner = "tristanpenman";
      repo = "valijson";
      rev = "v0.6";
      sha256 = "sha256-ZD19Q2MxMQd3yEKbY90GFCrerie5/jzgO8do4JQDoKM=";
    };
  
  in
  stdenv.mkDerivation rec {
    pname = "sysdig";
    version = "0.29.3";
  
    src = fetchFromGitHub {
      owner = "draios";
      repo = "sysdig";
      rev = version;
      sha256 = "sha256-dMLeroOd9CgvmgQdPfX8oBxQSyksZi/hP4vO03JhlF0=";
    };
  
    nativeBuildInputs = [ cmake perl installShellFiles pkg-config ];
    buildInputs = [
      luajit
      ncurses
      libb64
      openssl
      curl
      jq
      gcc
      elfutils
      tbb
      protobuf
      grpc
      libyamlcpp
      jsoncpp
      nlohmann_json
    ] ++ optionals (kernel != null) kernel.moduleBuildDependencies;
  
    hardeningDisable = [ "pic" ];
  