From f1035de47c8efb9bb7be7bf058dd23628c09d727 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 21 Aug 2009 09:08:55 +0000 Subject: [PATCH] * 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 --- doc/manual/default.nix | 11 ++++++++--- lib/eval-config.nix | 2 +- modules/services/misc/nixos-manual.nix | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/manual/default.nix b/doc/manual/default.nix index 271a6a54bcc0..d77a65bdf4a5 100644 --- a/doc/manual/default.nix +++ b/doc/manual/default.nix @@ -1,4 +1,4 @@ -{pkgs}: +{ pkgs, optionDeclarations }: let @@ -7,9 +7,14 @@ let 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 - (builtins.toXML (pkgs.lib.optionAttrSetToDocList "" - (import ../../lib/eval-config.nix {inherit pkgs; configuration = manualConfig;}).optionDeclarations))); + (builtins.toXML (pkgs.lib.optionAttrSetToDocList "" optionDeclarations_))); optionsDocBook = pkgs.runCommand "options-db.xml" {} '' ${pkgs.libxslt}/bin/xsltproc -o $out ${./options-to-docbook.xsl} ${options} diff --git a/lib/eval-config.nix b/lib/eval-config.nix index 9d6c5794df12..5554c659fcec 100644 --- a/lib/eval-config.nix +++ b/lib/eval-config.nix @@ -23,7 +23,7 @@ rec { ++ (import ../modules/module-list.nix); extraArgs = extraArgs_ // { - inherit pkgs; + inherit pkgs optionDeclarations; modulesPath = ../modules; }; diff --git a/modules/services/misc/nixos-manual.nix b/modules/services/misc/nixos-manual.nix index a886814d76d1..a113c8ee962e 100644 --- a/modules/services/misc/nixos-manual.nix +++ b/modules/services/misc/nixos-manual.nix @@ -3,7 +3,7 @@ # of the virtual consoles. The latter is useful for the installation # CD. -{pkgs, config, ...}: +{pkgs, config, optionDeclarations, ...}: let @@ -15,7 +15,7 @@ let # We could speed up the evaluation of the manual expression by # providing it the optionDeclarations of the current # configuration. - import ../../../doc/manual {inherit pkgs;}; + import ../../../doc/manual {inherit pkgs optionDeclarations;}; in