diff --git a/default.nix b/default.nix index 6df18b6..b482b2b 100644 --- a/default.nix +++ b/default.nix @@ -25,10 +25,28 @@ let buildPhase = '' make html ''; - installPhase = '' - mkdir -p $out - cp -R build/html/* $out/ - ''; + installPhase = + let + # Various versions of the Nix manuals, grep for (nix-manual)= + # FIXME: This requires human interaction to update! + # See ./CONTRIBUTING.md for details. + releases = [ + "2.19" + "2.18" + "2.13" + ]; + inputName = version: pkgs.lib.strings.replaceStrings [ "." ] [ "-" ] version; + src = version: (import inputs."nix_${inputName version}").default.doc; + copy = version: '' + cp -R ${src version}/share/doc/nix/manual/* $out/manual/nix/${version} + ''; + in + with pkgs.lib.strings; + '' + mkdir -p $out/manual/nix/{${concatStringsSep "," releases}} + ${concatStringsSep "\n" (map copy releases)} + cp -R build/html/* $out/ + ''; }; devmode = @@ -68,6 +86,7 @@ in inputsFrom = [ nix-dev ]; packages = [ devmode + pkgs.niv pkgs.python310.pkgs.black pkgs.vale ]; diff --git a/nix/sources.json b/nix/sources.json index 3befd57..fbb593f 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -1,4 +1,40 @@ { + "nix_2-13": { + "branch": "2.13-maintenance", + "description": "Nix, the purely functional package manager", + "homepage": "https://nixos.org/", + "owner": "nixos", + "repo": "nix", + "rev": "56eb17906822f14bb348017315cb1ca643da900a", + "sha256": "1k0x63l9crkrhdgdclcx8mp6r9mcp4brs67l6hsii1ag8gy2gmj4", + "type": "tarball", + "url": "https://github.com/nixos/nix/archive/56eb17906822f14bb348017315cb1ca643da900a.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "nix_2-18": { + "branch": "2.18-maintenance", + "description": "Nix, the purely functional package manager", + "homepage": "https://nixos.org/", + "owner": "nixos", + "repo": "nix", + "rev": "f5f4de6a550327b4b1a06123c2e450f1b92c73b6", + "sha256": "1g23sxsh9aj7sard5d3ijqfjqbh4fvlvyr73sj3dcdzcqiys5naq", + "type": "tarball", + "url": "https://github.com/nixos/nix/archive/f5f4de6a550327b4b1a06123c2e450f1b92c73b6.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "nix_2-19": { + "branch": "2.19-maintenance", + "description": "Nix, the purely functional package manager", + "homepage": "https://nixos.org/", + "owner": "nixos", + "repo": "nix", + "rev": "33bacbe220b49ceaaeb817354592a0102fbae087", + "sha256": "17fjz3mxqcszxfzpj48f8rqzdqavnnpibpi0ssw7vxmyybrqsqly", + "type": "tarball", + "url": "https://github.com/nixos/nix/archive/33bacbe220b49ceaaeb817354592a0102fbae087.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "nixpkgs": { "branch": "nixos-23.05", "description": "Nix Packages collection & NixOS", diff --git a/source/conf.py b/source/conf.py index a53ae29..82117e9 100644 --- a/source/conf.py +++ b/source/conf.py @@ -423,6 +423,11 @@ linkcheck_ignore = [ # Linkcheck fails on anchors in GH browser/file viewer, see https://github.com/sphinx-doc/sphinx/issues/11484 r"https://github\.com/.+/.+/blob/.*#.*$", r"https://github\.com/.+/.+/tree/.*#.*$", + # XXX: we use the web URL to the manuals we host within the build output, + # because Sphinx does not have facilities to deploy arbitrary files. + # since linkchecking those URLs will fail before actually deploying them, + # we ignore them here. + r"https://nix.dev/manual/.*$", ] # Anchors are not present in HTML diff --git a/source/reference/glossary.md b/source/reference/glossary.md index d04aab4..43e75bf 100644 --- a/source/reference/glossary.md +++ b/source/reference/glossary.md @@ -7,7 +7,7 @@ Nix Read /nɪks/ ("Niks"). :::{seealso} - - [Nix Reference Manual](https://nixos.org/manual/nix) + - [Nix Reference Manual](./nix-manual.md) - [Nix source code](https://github.com/NixOS/nix) ::: diff --git a/source/reference/index.md b/source/reference/index.md index 00dffe4..f42e487 100644 --- a/source/reference/index.md +++ b/source/reference/index.md @@ -7,7 +7,7 @@ These sections contains collections of detailed technical descriptions. :glob: :maxdepth: 2 -Nix Reference Manual +./nix-manual.md Nixpkgs Manual NixOS Manual Recommended support tools diff --git a/source/reference/nix-manual.md b/source/reference/nix-manual.md new file mode 100644 index 0000000..c05d91d --- /dev/null +++ b/source/reference/nix-manual.md @@ -0,0 +1,27 @@ +(nix-manual)= +# Nix reference manual + +```{toctree} +:hidden: + +Nix pre-release (development) +Nix 2.19 (latest) +Nix 2.18 (rolling) +Nix 2.13 (stable) +``` + +- [Nix pre-release](https://hydra.nixos.org/job/nix/master/build.x86_64-linux/latest/download) + + Reference documentation for the latest build from the `master` branch of the [Nix repository](https://github.com/NixOS/nix) + +- [Nix 2.19](https://nix.dev/manual/nix/2.19/) + + Reference documentation for the latest Nix release + +- [Nix 2.18](https://nix.dev/manual/nix/2.18/) + + Reference documentation for the Nix version shipped with the {term}`Nixpkgs` and {term}`NixOS` rolling release + +- [Nix 2.13 ](https://nix.dev/manual/nix/2.13/) + + Reference documentation for the Nix version shipped with the current {term}`Nixpkgs` and {term}`NixOS` stable release