angie: init at 1.4.0

This commit is contained in:
Izorkin
2023-11-20 23:04:20 +03:00
parent 00cb53de4f
commit 86efccfa45
5 changed files with 80 additions and 11 deletions

View File

@@ -649,6 +649,8 @@ in
Nginx package to use. This defaults to the stable version. Note Nginx package to use. This defaults to the stable version. Note
that the nginx team recommends to use the mainline version which that the nginx team recommends to use the mainline version which
available in nixpkgs as `nginxMainline`. available in nixpkgs as `nginxMainline`.
Supported Nginx forks include `angie`, `openresty` and `tengine`.
For HTTP/3 support use `nginxQuic` or `angieQuic`.
''; '';
}; };
@@ -1144,18 +1146,20 @@ in
} }
{ {
assertion = cfg.package.pname != "nginxQuic" -> !(cfg.enableQuicBPF); assertion = cfg.package.pname != "nginxQuic" && cfg.package.pname != "angieQuic" -> !(cfg.enableQuicBPF);
message = '' message = ''
services.nginx.enableQuicBPF requires using nginxQuic package, services.nginx.enableQuicBPF requires using nginxQuic package,
which can be achieved by setting `services.nginx.package = pkgs.nginxQuic;`. which can be achieved by setting `services.nginx.package = pkgs.nginxQuic;` or
`services.nginx.package = pkgs.angieQuic;`.
''; '';
} }
{ {
assertion = cfg.package.pname != "nginxQuic" -> all (host: !host.quic) (attrValues virtualHosts); assertion = cfg.package.pname != "nginxQuic" && cfg.package.pname != "angieQuic" -> all (host: !host.quic) (attrValues virtualHosts);
message = '' message = ''
services.nginx.service.virtualHosts.<name>.quic requires using nginxQuic package, services.nginx.service.virtualHosts.<name>.quic requires using nginxQuic or angie packages,
which can be achieved by setting `services.nginx.package = pkgs.nginxQuic;`. which can be achieved by setting `services.nginx.package = pkgs.nginxQuic;` or
`services.nginx.package = pkgs.angieQuic;`.
''; '';
} }

View File

@@ -7,17 +7,17 @@ with import ../lib/testing-python.nix { inherit system pkgs; };
builtins.listToAttrs ( builtins.listToAttrs (
builtins.map builtins.map
(nginxName: (nginxPackage:
{ {
name = nginxName; name = pkgs.lib.getName nginxPackage;
value = makeTest { value = makeTest {
name = "nginx-variant-${nginxName}"; name = "nginx-variant-${pkgs.lib.getName nginxPackage}";
nodes.machine = { pkgs, ... }: { nodes.machine = { pkgs, ... }: {
services.nginx = { services.nginx = {
enable = true; enable = true;
virtualHosts.localhost.locations."/".return = "200 'foo'"; virtualHosts.localhost.locations."/".return = "200 'foo'";
package = pkgs."${nginxName}"; package = nginxPackage;
}; };
}; };
@@ -29,5 +29,5 @@ builtins.listToAttrs (
}; };
} }
) )
[ "nginxStable" "nginxMainline" "nginxQuic" "nginxShibboleth" "openresty" "tengine" ] [ pkgs.angie pkgs.angieQuic pkgs.nginxStable pkgs.nginxMainline pkgs.nginxQuic pkgs.nginxShibboleth pkgs.openresty pkgs.tengine ]
) )

View File

@@ -0,0 +1,45 @@
{ callPackage
, runCommand
, lib
, fetchurl
, nixosTests
, withQuic ? false
, fetchpatch
, ...
}@args:
callPackage ../nginx/generic.nix args rec {
version = "1.4.0";
pname = if withQuic then "angieQuic" else "angie";
src = fetchurl {
url = "https://download.angie.software/files/angie-${version}.tar.gz";
hash = "sha256-gaQsPwoxtt6oVSDX1JCWvyUwDQaNprya79CCwu4z8b4=";
};
configureFlags = lib.optional withQuic [
"--with-http_v3_module"
];
preInstall = ''
if [[ -e man/angie.8 ]]; then
installManPage man/angie.8
fi
'';
postInstall = ''
ln -s $out/bin/nginx $out/bin/angie
'';
passthru.tests = {
angie = nixosTests.nginx-variants.angie;
};
meta = {
description = "Angie is an efficient, powerful, and scalable web server that was forked from nginx";
homepage = "https://angie.software/en/";
license = lib.licenses.bsd2;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ izorkin ];
};
}

View File

@@ -25,6 +25,7 @@ outer@{ lib, stdenv, fetchurl, fetchpatch, openssl, zlib, pcre, libxml2, libxslt
, fixPatch ? p: p , fixPatch ? p: p
, postPatch ? "" , postPatch ? ""
, preConfigure ? "" , preConfigure ? ""
, preInstall ? ""
, postInstall ? "" , postInstall ? ""
, meta ? null , meta ? null
, nginx-doc ? outer.nginx-doc , nginx-doc ? outer.nginx-doc
@@ -179,7 +180,7 @@ stdenv.mkDerivation {
if [[ -e man/nginx.8 ]]; then if [[ -e man/nginx.8 ]]; then
installManPage man/nginx.8 installManPage man/nginx.8
fi fi
''; '' + preInstall;
disallowedReferences = map (m: m.src) modules; disallowedReferences = map (m: m.src) modules;

View File

@@ -3250,6 +3250,25 @@ with pkgs;
anewer = callPackage ../tools/text/anewer { }; anewer = callPackage ../tools/text/anewer { };
angie = callPackage ../servers/http/angie {
zlib = zlib-ng.override { withZlibCompat = true; };
withPerl = false;
# We don't use `with` statement here on purpose!
# See https://github.com/NixOS/nixpkgs/pull/10474#discussion_r42369334
modules = [ nginxModules.rtmp nginxModules.dav nginxModules.moreheaders ];
};
angieQuic = callPackage ../servers/http/angie {
zlib = zlib-ng.override { withZlibCompat = true; };
withPerl = false;
withQuic = true;
# We don't use `with` statement here on purpose!
# See https://github.com/NixOS/nixpkgs/pull/10474#discussion_r42369334
modules = [ nginxModules.rtmp nginxModules.dav nginxModules.moreheaders ];
# Use latest quictls to allow http3 support
openssl = quictls;
};
angle-grinder = callPackage ../tools/text/angle-grinder { }; angle-grinder = callPackage ../tools/text/angle-grinder { };
ansifilter = callPackage ../tools/text/ansifilter { }; ansifilter = callPackage ../tools/text/ansifilter { };