anchor.diff:  { useLua ? !stdenv.isDarwin
   , usePcre ? true
  -, stdenv, fetchurl
  -, openssl, zlib, lua5_3 ? null, pcre ? null
  +, withPrometheusExporter ? true
  +, stdenv, lib, fetchurl
  +, openssl, zlib
  +, lua5_3 ? null, pcre ? null, systemd ? null
   }:
   
   assert useLua -> lua5_3 != null;
  
positive.code: 
  stdenv.mkDerivation rec {
    pname = "haproxy";
    version = "1.9.8";
  
    src = fetchurl {
      url = "https://www.haproxy.org/download/${stdenv.lib.versions.majorMinor version}/src/${pname}-${version}.tar.gz";
      sha256 = "1via9k84ycrdr8qh4qchcbqgpv0gynm3ra23nwsvqwfqvc0376id";
    };
  
    buildInputs = [ openssl zlib ]
      ++ stdenv.lib.optional useLua lua5_3
      ++ stdenv.lib.optional usePcre pcre;
  
    # TODO: make it work on bsd as well
    makeFlags = [
      "PREFIX=\${out}"
      ("TARGET=" + (if stdenv.isSunOS  then "solaris"
               else if stdenv.isLinux  then "linux2628"
               else if stdenv.isDarwin then "osx"
               else "generic"))
    ];
    buildFlags = [
      "USE_OPENSSL=yes"
      "USE_ZLIB=yes"
    ] ++ stdenv.lib.optionals usePcre [
      "USE_PCRE=yes"
      "USE_PCRE_JIT=yes"
    ] ++ stdenv.lib.optionals useLua [
      "USE_LUA=yes"
      "LUA_LIB=${lua5_3}/lib"
      "LUA_INC=${lua5_3}/include"
    ] ++ stdenv.lib.optional stdenv.isDarwin "CC=cc"
      ++ stdenv.lib.optional stdenv.isLinux "USE_GETADDRINFO=1";
  
    meta = {
      description = "Reliable, high performance TCP/HTTP load balancer";
      longDescription = ''
        HAProxy is a free, very fast and reliable solution offering high
  
negative.code:       tens of thousands of connections is clearly realistic with todays
        hardware.
      '';
      homepage = "https://haproxy.org";
      license = licenses.gpl2;
      maintainers = with maintainers; [ fuzzy-id ];
      platforms = with platforms; linux ++ darwin;
    };
  }
  