summaryrefslogtreecommitdiff
path: root/modules/documentation/default.nix
diff options
context:
space:
mode:
authorEmily <vcs@emily.moe>2023-06-22 00:15:18 +0100
committerEmily <vcs@emily.moe>2023-06-24 10:48:55 +0100
commit76ce9faca6e16d348afb9d78a1a13eb19c381b76 (patch)
treedaaab5ce1f2c633aa58b7e177593dff05d579136 /modules/documentation/default.nix
parent96cb49133b813d9902f6417e5b725a01bbaacb2f (diff)
doc/manual: use `nixosOptionDoc`
The only change to `options.json` are that the `declarations` fields now contain correct GitHub URLs. The changes to the HTML manual are all either strict improvements: * "Declared by:" links point to the correct URLs. * `lib.mdDoc` documentation is included. or else trivial: * Additional whitespace in the HTML source. * Some interchange of `<pre class="programlisting">` and `<code class="literal">`. * Fancy quotes used in some type descriptions. `optionsDocBook` is exported temporarily as it is used by `nix-doc-munge` for the Markdown conversion process. This drops support for building the manual on 22.11, which lacks a complete implementation of this processor, and provides stubbed-out manual packages with an explanation on that version.
Diffstat (limited to 'modules/documentation/default.nix')
-rw-r--r--modules/documentation/default.nix36
1 files changed, 35 insertions, 1 deletions
diff --git a/modules/documentation/default.nix b/modules/documentation/default.nix
index 6bd3412..d741995 100644
--- a/modules/documentation/default.nix
+++ b/modules/documentation/default.nix
@@ -21,10 +21,11 @@ let
It isn't perfect, but it seems to cover a vast majority of use cases.
Caveat: even if the package is reached by a different means,
the path above will be shown and not e.g. `${config.services.foo.package}`. */
- manual = import ../../doc/manual rec {
+ realManual = import ../../doc/manual {
inherit pkgs config;
version = config.system.darwinVersion;
revision = config.system.darwinRevision;
+ nixpkgsRevision = config.system.nixpkgsRevision;
options =
let
scrubbedEval = evalModules {
@@ -43,6 +44,39 @@ let
in scrubbedEval.options;
};
+ # TODO: Remove this when dropping 22.11 support.
+ manual = realManual //
+ lib.optionalAttrs (lib.versionOlder lib.version "23.05-pre") rec {
+ optionsJSON = pkgs.writeTextFile {
+ name = "options.json-stub";
+ destination = "/share/doc/darwin/options.json";
+ text = "{}";
+ };
+ manpages = pkgs.writeTextFile {
+ name = "darwin-manpages-stub";
+ destination = "/share/man/man5/configuration.nix.5";
+ text = ''
+ .TH "CONFIGURATION\&.NIX" "5" "01/01/1980" "Darwin" "Darwin Reference Pages"
+ .SH "NAME"
+ \fIconfiguration\&.nix\fP \- Darwin system configuration specification
+ .SH "DESCRIPTION"
+ .PP
+ The nix\-darwin documentation now requires nixpkgs 23.05 to build.
+ '';
+ };
+ manualHTML = pkgs.writeTextFile {
+ name = "darwin-manual-html-stub";
+ destination = "/share/doc/darwin/index.html";
+ text = ''
+ <!DOCTYPE html>
+ <title>Darwin Configuration Options</title>
+ The nix-darwin documentation now requires nixpkgs 23.05 to build.
+ '';
+ };
+ manual = manualHTML;
+ manualHTMLIndex = "${manualHTML}/share/doc/darwin/index.html";
+ };
+
helpScript = pkgs.writeScriptBin "darwin-help"
''
#! ${pkgs.stdenv.shell} -e