nginxModules.http_proxy_connect_module: init
This adds the nginx module `ngx_http_proxy_connect_module` which allows to tunnel HTTPS through an nginx proxy[1]. As this module contained patches for several nginx version, some minor adjustments were needed: * Allowed each entry in `nginxModules` to provide patches. * Added an optional `supports` attribute to ensure that each module can determine if it supports the currently built nginx version (e.g. stable 1.14 ATM or mainline 1.15 ATM). [1] https://github.com/chobits/ngx_http_proxy_connect_module
This commit is contained in:
@@ -9,6 +9,17 @@
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let
|
||||
|
||||
mapModules = attrPath: flip concatMap modules
|
||||
(mod:
|
||||
let supports = mod.supports or (_: true);
|
||||
in
|
||||
if supports version then mod.${attrPath} or []
|
||||
else throw "Module at ${toString mod.src} does not support nginx version ${version}!");
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "nginx-${version}";
|
||||
|
||||
@@ -18,7 +29,7 @@ stdenv.mkDerivation {
|
||||
};
|
||||
|
||||
buildInputs = [ openssl zlib pcre libxml2 libxslt gd geoip ]
|
||||
++ concatMap (mod: mod.inputs or []) modules;
|
||||
++ mapModules "inputs";
|
||||
|
||||
configureFlags = [
|
||||
"--with-http_ssl_module"
|
||||
@@ -77,7 +88,7 @@ stdenv.mkDerivation {
|
||||
url = "https://raw.githubusercontent.com/openwrt/packages/master/net/nginx/patches/103-sys_nerr.patch";
|
||||
sha256 = "0s497x6mkz947aw29wdy073k8dyjq8j99lax1a1mzpikzr4rxlmd";
|
||||
})
|
||||
];
|
||||
] ++ mapModules "patches";
|
||||
|
||||
hardeningEnable = optional (!stdenv.isDarwin) "pie";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user