1 { stdenv, lib, fetchFromGitHub, pkg-config, autoreconfHook
2 , curl, apacheHttpd, pcre, apr, aprutil, libxml2
3 , luaSupport ? false, lua5, perl
6 let luaValue = if luaSupport then lua5 else "no";
7 optional = lib.optional;
10 stdenv.mkDerivation rec {
11 pname = "modsecurity";
14 src = fetchFromGitHub {
15 owner = "owasp-modsecurity";
18 sha256 = "sha256-hJ8wYeC83dl85bkUXGZKHpHzw9QRgtusj1/+Coxsx0k=";
21 nativeBuildInputs = [ pkg-config autoreconfHook ];
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.am.patch ];
43 nativeCheckInputs = [ perl ];
51 description = "Open source, cross-platform web application firewall (WAF)";
52 license = licenses.asl20;
53 homepage = "https://github.com/owasp-modsecurity/ModSecurity";
54 maintainers = with maintainers; [offline];
55 platforms = lib.platforms.linux ++ lib.platforms.darwin;