1 { lib, stdenv, libxml2, libxslt, fetchhg }:
3 # Upstream maintains documentation (sources of https://nginx.org) in separate
4 # mercurial repository, which do not correspond to particular git commit, but at
5 # least has "introduced in version X.Y" comments.
7 # In other words, documentation does not necessary matches capabilities of
8 # $out/bin/nginx, but we have no better options.
10 pname = "nginx-doc-unstable";
11 version = "2022-05-05";
13 url = "https://hg.nginx.org/nginx.org";
15 sha256 = "029n4mnmjw94h01qalmjgf1c2h3h7wm798xv5knk3padxiy4m28b";
17 patches = [ ./exclude-google-analytics.patch ];
18 nativeBuildInputs = [ libxslt libxml2 ];
20 # Generated documentation is not local-friendly, since it assumes that link to directory
21 # is the same as link to index.html in that directory, which is not how browsers behave
22 # with local filesystem.
24 # TODO: patch all relative links that do not end with .html.
26 # /en subdirectory must exist, relative links expect it.
28 mkdir -p $out/share/doc/nginx
29 mv libxslt/en $out/share/doc/nginx
33 description = "Reverse proxy and lightweight webserver (documentation)";
34 homepage = "https://nginx.org/";
35 license = licenses.bsd2;
36 platforms = platforms.all;
38 maintainers = with maintainers; [ kaction ];