nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 libxml2,
5 libxslt,
6 fetchhg,
7}:
8
9# Upstream maintains documentation (sources of https://nginx.org) in separate
10# mercurial repository, which do not correspond to particular git commit, but at
11# least has "introduced in version X.Y" comments.
12#
13# In other words, documentation does not necessary matches capabilities of
14# $out/bin/nginx, but we have no better options.
15stdenv.mkDerivation {
16 pname = "nginx-doc-unstable";
17 version = "2022-05-05";
18 src = fetchhg {
19 url = "https://hg.nginx.org/nginx.org";
20 rev = "a3aee2697d4e";
21 sha256 = "029n4mnmjw94h01qalmjgf1c2h3h7wm798xv5knk3padxiy4m28b";
22 };
23 patches = [ ./exclude-google-analytics.patch ];
24 nativeBuildInputs = [
25 libxslt
26 libxml2
27 ];
28
29 # Generated documentation is not local-friendly, since it assumes that link to directory
30 # is the same as link to index.html in that directory, which is not how browsers behave
31 # with local filesystem.
32 #
33 # TODO: patch all relative links that do not end with .html.
34
35 # /en subdirectory must exist, relative links expect it.
36 installPhase = ''
37 mkdir -p $out/share/doc/nginx
38 mv libxslt/en $out/share/doc/nginx
39 '';
40
41 meta = with lib; {
42 description = "Reverse proxy and lightweight webserver (documentation)";
43 homepage = "https://nginx.org/";
44 license = licenses.bsd2;
45 platforms = platforms.all;
46 priority = 6;
47 maintainers = with maintainers; [ kaction ];
48 };
49}