about summary refs log tree commit diff
path: root/pkgs/servers/http
diff options
context:
space:
mode:
authorMathijs Kwik <mathijs@bluescreen303.nl>2014-06-03 15:59:08 +0200
committerMathijs Kwik <mathijs@bluescreen303.nl>2014-06-16 22:43:58 +0200
commit76c2c0c499c6472cd2fbed81899dd2996bb16c07 (patch)
tree0bdce0d4d9258ec08f4ccf2c33b57ffbc81330c1 /pkgs/servers/http
parentc585786c1fccaac001ef7e20227219e0aabef696 (diff)
downloadnixlib-76c2c0c499c6472cd2fbed81899dd2996bb16c07.tar
nixlib-76c2c0c499c6472cd2fbed81899dd2996bb16c07.tar.gz
nixlib-76c2c0c499c6472cd2fbed81899dd2996bb16c07.tar.bz2
nixlib-76c2c0c499c6472cd2fbed81899dd2996bb16c07.tar.lz
nixlib-76c2c0c499c6472cd2fbed81899dd2996bb16c07.tar.xz
nixlib-76c2c0c499c6472cd2fbed81899dd2996bb16c07.tar.zst
nixlib-76c2c0c499c6472cd2fbed81899dd2996bb16c07.zip
nginx: add echo module, fix aio on linux&freebsd
Diffstat (limited to 'pkgs/servers/http')
-rw-r--r--pkgs/servers/http/nginx/default.nix32
1 files changed, 22 insertions, 10 deletions
diff --git a/pkgs/servers/http/nginx/default.nix b/pkgs/servers/http/nginx/default.nix
index 32d4634e7fb9..8f748078dcf0 100644
--- a/pkgs/servers/http/nginx/default.nix
+++ b/pkgs/servers/http/nginx/default.nix
@@ -3,7 +3,10 @@
 , rtmp ? false
 , fullWebDAV ? false
 , syslog ? false
-, moreheaders ? false}:
+, moreheaders ? false
+, echo ? false }:
+
+with stdenv.lib;
 
 let
   version = "1.6.0";
@@ -35,6 +38,12 @@ let
     rev = "0c6e05d3125a97892a250e9ba8b7674163ba500b";
     sha256 = "e121d97fd3c81c64e6cbf6902bbcbdb01be9ac985c6832d40434379d5e998eaf";
   };
+
+  echo-ext = fetchgit {
+    url = https://github.com/openresty/echo-nginx-module.git;
+    rev = "refs/tags/v0.53";
+    sha256 = "90d4e3a49c678019f4f335bc18529aa108fcc9cfe0747ea4e2f6084a70da2868";
+  };
 in
 
 stdenv.mkDerivation rec {
@@ -43,7 +52,7 @@ stdenv.mkDerivation rec {
 
   buildInputs =
     [ openssl zlib pcre libxml2 libxslt gd geoip
-    ] ++ stdenv.lib.optional fullWebDAV expat;
+    ] ++ optional fullWebDAV expat;
 
   patches = if syslog then [ "${syslog-ext}/syslog-1.5.6.patch" ] else [];
 
@@ -69,12 +78,15 @@ stdenv.mkDerivation rec {
     "--with-ipv6"
     # Install destination problems
     # "--with-http_perl_module"
-  ] ++ stdenv.lib.optional rtmp "--add-module=${rtmp-ext}"
-    ++ stdenv.lib.optional fullWebDAV "--add-module=${dav-ext}"
-    ++ stdenv.lib.optional syslog "--add-module=${syslog-ext}"
-    ++ stdenv.lib.optional moreheaders "--add-module=${moreheaders-ext}";
+  ] ++ optional rtmp "--add-module=${rtmp-ext}"
+    ++ optional fullWebDAV "--add-module=${dav-ext}"
+    ++ optional syslog "--add-module=${syslog-ext}"
+    ++ optional moreheaders "--add-module=${moreheaders-ext}"
+    ++ optional echo "--add-module=${echo-ext}"
+    ++ optional (elem stdenv.system (with platforms; linux ++ freebsd)) "--with-file-aio";
+
 
-  additionalFlags = stdenv.lib.optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations";
+  additionalFlags = optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations";
 
   preConfigure = ''
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2 $additionalFlags"
@@ -87,8 +99,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A reverse proxy and lightweight webserver";
     homepage    = http://nginx.org;
-    license     = stdenv.lib.licenses.bsd2;
-    platforms   = stdenv.lib.platforms.all;
-    maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin ];
+    license     = licenses.bsd2;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ thoughtpolice raskin ];
   };
 }