2020-04-24 23:36:52 +00:00
|
|
|
{ callPackage
|
|
|
|
, runCommand
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, postgresql
|
|
|
|
, ...
|
|
|
|
}@args:
|
|
|
|
|
|
|
|
callPackage ../nginx/generic.nix args rec {
|
|
|
|
pname = "openresty";
|
2020-09-25 04:45:31 +00:00
|
|
|
nginxVersion = "1.17.8";
|
|
|
|
version = "${nginxVersion}.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://openresty.org/download/openresty-${version}.tar.gz";
|
2020-09-25 04:45:31 +00:00
|
|
|
sha256 = "1813w33hjm1hcqvl3b3f67qgi5zfjiqg6s01hiy12a5j3jqilcig";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
fixPatch = patch: let name = patch.name or (builtins.baseNameOf patch); in
|
|
|
|
runCommand "openresty-${name}" { src = patch; } ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substitute $src $out \
|
2020-05-15 21:57:56 +00:00
|
|
|
--replace "a/" "a/bundle/nginx-${nginxVersion}/" \
|
|
|
|
--replace "b/" "b/bundle/nginx-${nginxVersion}/"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ postgresql ];
|
|
|
|
|
|
|
|
configureFlags = [ "--with-http_postgres_module" ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
ln -s $out/luajit/bin/luajit-2.1.0-beta3 $out/bin/luajit-openresty
|
|
|
|
ln -s $out/nginx/sbin/nginx $out/bin/nginx
|
2020-06-15 15:56:04 +00:00
|
|
|
ln -s $out/nginx/conf $out/conf
|
|
|
|
ln -s $out/nginx/html $out/html
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A fast web application server built on Nginx";
|
|
|
|
homepage = "http://openresty.org";
|
|
|
|
license = lib.licenses.bsd2;
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
maintainers = with lib.maintainers; [ thoughtpolice lblasc emily ];
|
|
|
|
};
|
|
|
|
}
|