1 { stdenv, lib, fetchurl, pkg-config
2 , curl, apacheHttpd, pcre, apr, aprutil, libxml2
3 , luaSupport ? false, lua5
8 let luaValue = if luaSupport then lua5 else "no";
9 optional = lib.optional;
12 stdenv.mkDerivation rec {
13 pname = "modsecurity";
17 url = "https://www.modsecurity.org/tarball/${version}/${pname}-${version}.tar.gz";
18 sha256 = "0611nskd2y6yagrciqafxdn4rxbdk2v4swf45kc1sgwx2sfh34j1";
21 nativeBuildInputs = [ pkg-config ];
22 buildInputs = [ curl apacheHttpd pcre apr aprutil libxml2 ] ++
23 optional luaSupport lua5;
26 "--enable-standalone-module"
28 "--with-curl=${curl.dev}"
29 "--with-apxs=${apacheHttpd.dev}/bin/apxs"
30 "--with-pcre=${pcre.dev}"
31 "--with-apr=${apr.dev}"
32 "--with-apu=${aprutil.dev}/bin/apu-1-config"
33 "--with-libxml=${libxml2.dev}"
34 "--with-lua=${luaValue}"
37 outputs = ["out" "nginx"];
38 # by default modsecurity's install script copies compiled output to httpd's modules folder
39 # this patch removes those lines
40 patches = [ ./Makefile.in.patch ];
48 description = "Open source, cross-platform web application firewall (WAF)";
49 license = licenses.asl20;
50 homepage = "https://www.modsecurity.org/";
51 maintainers = with maintainers; [offline];
52 platforms = lib.platforms.linux ++ lib.platforms.darwin;