You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
1.9 KiB
68 lines
1.9 KiB
10 years ago
|
{ stdenv, fetchurl, fetchFromGitHub, openssl, zlib, pcre, libxml2, libxslt, expat
|
||
9 years ago
|
, gd, geoip
|
||
8 years ago
|
, withStream ? false
|
||
9 years ago
|
, modules ? []
|
||
8 years ago
|
, hardening ? true
|
||
8 years ago
|
, version, sha256, ...
|
||
10 years ago
|
}:
|
||
10 years ago
|
|
||
|
with stdenv.lib;
|
||
12 years ago
|
|
||
8 years ago
|
stdenv.mkDerivation {
|
||
8 years ago
|
name = "nginx-${version}";
|
||
|
|
||
|
src = fetchurl {
|
||
11 years ago
|
url = "http://nginx.org/download/nginx-${version}.tar.gz";
|
||
8 years ago
|
inherit sha256;
|
||
11 years ago
|
};
|
||
|
|
||
12 years ago
|
|
||
10 years ago
|
buildInputs =
|
||
9 years ago
|
[ openssl zlib pcre libxml2 libxslt gd geoip ]
|
||
|
++ concatMap (mod: mod.inputs or []) modules;
|
||
11 years ago
|
|
||
16 years ago
|
configureFlags = [
|
||
|
"--with-http_ssl_module"
|
||
8 years ago
|
"--with-http_v2_module"
|
||
10 years ago
|
"--with-http_realip_module"
|
||
|
"--with-http_addition_module"
|
||
16 years ago
|
"--with-http_xslt_module"
|
||
10 years ago
|
"--with-http_image_filter_module"
|
||
|
"--with-http_geoip_module"
|
||
16 years ago
|
"--with-http_sub_module"
|
||
|
"--with-http_dav_module"
|
||
10 years ago
|
"--with-http_flv_module"
|
||
|
"--with-http_mp4_module"
|
||
|
"--with-http_gunzip_module"
|
||
16 years ago
|
"--with-http_gzip_static_module"
|
||
10 years ago
|
"--with-http_auth_request_module"
|
||
|
"--with-http_random_index_module"
|
||
16 years ago
|
"--with-http_secure_link_module"
|
||
10 years ago
|
"--with-http_degradation_module"
|
||
10 years ago
|
"--with-http_stub_status_module"
|
||
11 years ago
|
"--with-ipv6"
|
||
14 years ago
|
# Install destination problems
|
||
12 years ago
|
# "--with-http_perl_module"
|
||
8 years ago
|
] ++ optional withStream "--with-stream"
|
||
|
++ optional (elem stdenv.system (with platforms; linux ++ freebsd)) "--with-file-aio"
|
||
9 years ago
|
++ map (mod: "--add-module=${mod.src}") modules;
|
||
10 years ago
|
|
||
8 years ago
|
NIX_CFLAGS_COMPILE = [ "-I${libxml2.dev}/include/libxml2" ] ++ optional stdenv.isDarwin "-Wno-error=deprecated-declarations";
|
||
9 years ago
|
|
||
8 years ago
|
preConfigure = (concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules);
|
||
16 years ago
|
|
||
8 years ago
|
hardeningEnable = [ "pie" ];
|
||
8 years ago
|
|
||
8 years ago
|
postInstall = ''
|
||
|
mv $out/sbin $out/bin
|
||
|
'';
|
||
|
|
||
16 years ago
|
meta = {
|
||
12 years ago
|
description = "A reverse proxy and lightweight webserver";
|
||
10 years ago
|
homepage = http://nginx.org;
|
||
10 years ago
|
license = licenses.bsd2;
|
||
|
platforms = platforms.all;
|
||
|
maintainers = with maintainers; [ thoughtpolice raskin ];
|
||
16 years ago
|
};
|
||
|
}
|