13 callPackage ../nginx/generic.nix args rec {
15 nginxVersion = "1.27.1";
16 version = "${nginxVersion}.1";
19 url = "https://openresty.org/download/openresty-${version}.tar.gz";
20 sha256 = "sha256-ebBx4nvcFD1fQB0Nv1BN5EIAcNhnU4xe3CVG0DUf1cA=";
23 # generic.nix applies fixPatch on top of every patch defined there.
24 # This allows updating the patch destination, as openresty has
25 # nginx source code in a different folder.
29 name = patch.name or (builtins.baseNameOf patch);
31 runCommand "openresty-${name}" { src = patch; } ''
32 substitute $src $out \
33 --replace "a/" "a/bundle/nginx-${nginxVersion}/" \
34 --replace "b/" "b/bundle/nginx-${nginxVersion}/"
37 nativeBuildInputs = [ perl ];
39 buildInputs = [ postgresql ];
42 patchShebangs configure bundle/
45 configureFlags = lib.optional withPostgres [ "--with-http_postgres_module" ];
48 ln -s $out/luajit/bin/luajit-2.1.ROLLING $out/bin/luajit-openresty
49 ln -sf $out/nginx/bin/nginx $out/bin/openresty
50 ln -s $out/nginx/bin/nginx $out/bin/nginx
51 ln -s $out/nginx/conf $out/conf
52 ln -s $out/nginx/html $out/html
56 inherit (nixosTests) openresty-lua;
60 description = "Fast web application server built on Nginx";
61 homepage = "https://openresty.org";
62 license = lib.licenses.bsd2;
63 platforms = lib.platforms.all;
64 maintainers = with lib.maintainers; [