mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
* For the generation of manual / manpages, don't evaluate the option
declarations again (because we already have them). This cuts evaluation time from 7.2s to 4.9s. svn path=/nixos/trunk/; revision=16798
This commit is contained in:
parent
b48a1c394b
commit
f1035de47c
3 changed files with 11 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
{pkgs}:
|
{ pkgs, optionDeclarations }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
@ -7,9 +7,14 @@ let
|
||||||
services.nixosManual.enable = false;
|
services.nixosManual.enable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# To prevent infinite recursion, remove system.path from the
|
||||||
|
# options. Not sure why this happens.
|
||||||
|
optionDeclarations_ =
|
||||||
|
optionDeclarations //
|
||||||
|
{ system = removeAttrs optionDeclarations.system ["path"]; };
|
||||||
|
|
||||||
options = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext
|
options = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext
|
||||||
(builtins.toXML (pkgs.lib.optionAttrSetToDocList ""
|
(builtins.toXML (pkgs.lib.optionAttrSetToDocList "" optionDeclarations_)));
|
||||||
(import ../../lib/eval-config.nix {inherit pkgs; configuration = manualConfig;}).optionDeclarations)));
|
|
||||||
|
|
||||||
optionsDocBook = pkgs.runCommand "options-db.xml" {} ''
|
optionsDocBook = pkgs.runCommand "options-db.xml" {} ''
|
||||||
${pkgs.libxslt}/bin/xsltproc -o $out ${./options-to-docbook.xsl} ${options}
|
${pkgs.libxslt}/bin/xsltproc -o $out ${./options-to-docbook.xsl} ${options}
|
||||||
|
|
|
@ -23,7 +23,7 @@ rec {
|
||||||
++ (import ../modules/module-list.nix);
|
++ (import ../modules/module-list.nix);
|
||||||
|
|
||||||
extraArgs = extraArgs_ // {
|
extraArgs = extraArgs_ // {
|
||||||
inherit pkgs;
|
inherit pkgs optionDeclarations;
|
||||||
modulesPath = ../modules;
|
modulesPath = ../modules;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# of the virtual consoles. The latter is useful for the installation
|
# of the virtual consoles. The latter is useful for the installation
|
||||||
# CD.
|
# CD.
|
||||||
|
|
||||||
{pkgs, config, ...}:
|
{pkgs, config, optionDeclarations, ...}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ let
|
||||||
# We could speed up the evaluation of the manual expression by
|
# We could speed up the evaluation of the manual expression by
|
||||||
# providing it the optionDeclarations of the current
|
# providing it the optionDeclarations of the current
|
||||||
# configuration.
|
# configuration.
|
||||||
import ../../../doc/manual {inherit pkgs;};
|
import ../../../doc/manual {inherit pkgs optionDeclarations;};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue