nixos: doc: rename manual to manualHTML, cleanup references

Because when I see "config.system.build.manual.manual" after I forgot
what it means I ask "Why do I need that second `.manual` there again?".
Doesn't happen with `config.system.build.manual.manualHTML`.
This commit is contained in:
Jan Malakhovski 2018-09-06 19:17:44 +00:00
parent 56853dc6d8
commit fe744d3fb1
5 changed files with 13 additions and 9 deletions

View File

@ -252,7 +252,7 @@ in rec {
''; # */ ''; # */
# Generate the NixOS manual. # Generate the NixOS manual.
manual = runCommand "nixos-manual" manualHTML = runCommand "nixos-manual-html"
{ inherit sources; { inherit sources;
nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ]; nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
meta.description = "The NixOS manual in HTML format"; meta.description = "The NixOS manual in HTML format";
@ -281,6 +281,11 @@ in rec {
echo "doc manual $dst" >> $out/nix-support/hydra-build-products echo "doc manual $dst" >> $out/nix-support/hydra-build-products
''; # */ ''; # */
# Alias for backward compatibility. TODO(@oxij): remove eventually.
manual = manualHTML;
# Index page of the NixOS manual.
manualHTMLIndex = "${manualHTML}/share/doc/nixos/index.html";
manualEpub = runCommand "nixos-manual-epub" manualEpub = runCommand "nixos-manual-epub"
{ inherit sources; { inherit sources;

View File

@ -34,7 +34,7 @@ $ nix-build -A system</screen>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<varname>system.build.manual.manual</varname> <varname>system.build.manual.manualHTML</varname>
</term> </term>
<listitem> <listitem>
<para> <para>

View File

@ -30,7 +30,7 @@ with lib;
Version=1.0 Version=1.0
Type=Application Type=Application
Name=NixOS Manual Name=NixOS Manual
Exec=firefox ${config.system.build.manual.manual}/share/doc/nixos/index.html Exec=firefox ${config.system.build.manual.manualHTMLIndex}
Icon=text-html Icon=text-html
''; '';

View File

@ -39,8 +39,6 @@ let
in scrubbedEval.options; in scrubbedEval.options;
}; };
entry = "${manual.manual}/share/doc/nixos/index.html";
helpScript = pkgs.writeScriptBin "nixos-help" helpScript = pkgs.writeScriptBin "nixos-help"
'' ''
#! ${pkgs.runtimeShell} -e #! ${pkgs.runtimeShell} -e
@ -61,7 +59,7 @@ let
fi fi
fi fi
fi fi
exec "$browser" ${entry} exec "$browser" ${manual.manualHTMLIndex}
''; '';
desktopItem = pkgs.makeDesktopItem { desktopItem = pkgs.makeDesktopItem {
@ -121,7 +119,7 @@ in
environment.systemPackages = [] environment.systemPackages = []
++ optionals config.services.xserver.enable [ desktopItem pkgs.nixos-icons ] ++ optionals config.services.xserver.enable [ desktopItem pkgs.nixos-icons ]
++ optional config.documentation.man.enable manual.manpages ++ optional config.documentation.man.enable manual.manpages
++ optionals config.documentation.doc.enable [ manual.manual helpScript ]; ++ optionals config.documentation.doc.enable [ manual.manualHTML helpScript ];
boot.extraTTYs = mkIf cfg.showManual ["tty${toString cfg.ttyNumber}"]; boot.extraTTYs = mkIf cfg.showManual ["tty${toString cfg.ttyNumber}"];
@ -130,7 +128,7 @@ in
{ description = "NixOS Manual"; { description = "NixOS Manual";
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = serviceConfig =
{ ExecStart = "${cfg.browser} ${entry}"; { ExecStart = "${cfg.browser} ${manual.manualHTMLIndex}";
StandardInput = "tty"; StandardInput = "tty";
StandardOutput = "tty"; StandardOutput = "tty";
TTYPath = "/dev/tty${toString cfg.ttyNumber}"; TTYPath = "/dev/tty${toString cfg.ttyNumber}";

View File

@ -128,7 +128,8 @@ in rec {
channel = import lib/make-channel.nix { inherit pkgs nixpkgs version versionSuffix; }; channel = import lib/make-channel.nix { inherit pkgs nixpkgs version versionSuffix; };
manual = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manual); manualHTML = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manualHTML);
manual = manualHTML; # TODO(@oxij): remove eventually
manualEpub = (buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manualEpub)); manualEpub = (buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manualEpub));
manpages = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manpages); manpages = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manpages);
manualGeneratedSources = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.generatedSources); manualGeneratedSources = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.generatedSources);