From 10e9705a86fc96aa121e25d80ec46d0f86cc9db2 Mon Sep 17 00:00:00 2001 From: Nicolas Pierron Date: Tue, 15 Sep 2009 14:09:18 +0000 Subject: [PATCH] Replace optionDeclarations by options which is directly computed by moduleMerge. svn path=/nixos/trunk/; revision=17166 --- doc/manual/default.nix | 20 +++++++------------- lib/eval-config.nix | 5 +++-- modules/services/misc/nixos-manual.nix | 7 +++---- release.nix | 4 ++-- 4 files changed, 15 insertions(+), 21 deletions(-) diff --git a/doc/manual/default.nix b/doc/manual/default.nix index d77a65bdf4a5..fad32986538b 100644 --- a/doc/manual/default.nix +++ b/doc/manual/default.nix @@ -1,23 +1,17 @@ -{ pkgs, optionDeclarations }: +{ pkgs, options }: let - - manualConfig = - { environment.checkConfigurationOptions = 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_ = + options // + { system = removeAttrs options.system ["path"]; }; - options = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext - (builtins.toXML (pkgs.lib.optionAttrSetToDocList "" optionDeclarations_))); + optionsXML = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext + (builtins.toXML (pkgs.lib.optionAttrSetToDocList "" options_))); 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} ${optionsXML} ''; manual = pkgs.stdenv.mkDerivation { diff --git a/lib/eval-config.nix b/lib/eval-config.nix index be683c8b2fad..10efb8a251d4 100644 --- a/lib/eval-config.nix +++ b/lib/eval-config.nix @@ -25,11 +25,12 @@ rec { optionDefinitions = systemModule.config; optionDeclarations = systemModule.options; + inherit (systemModule) options; # These are the extra arguments passed to every module. In # particular, Nixpkgs is passed through the "pkgs" argument. extraArgs = extraArgs_ // { - inherit pkgs optionDeclarations; + inherit pkgs; modulesPath = ../modules; servicesPath = services; }; @@ -62,5 +63,5 @@ rec { # option declarations. config = pkgs.checker optionDefinitions optionDefinitions.environment.checkConfigurationOptions - optionDeclarations optionDefinitions; + options optionDefinitions; } diff --git a/modules/services/misc/nixos-manual.nix b/modules/services/misc/nixos-manual.nix index a113c8ee962e..45a38c778ead 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, optionDeclarations, ...}: +{pkgs, config, options, ...}: let @@ -13,9 +13,8 @@ let manual = # We could speed up the evaluation of the manual expression by - # providing it the optionDeclarations of the current - # configuration. - import ../../../doc/manual {inherit pkgs optionDeclarations;}; + # providing it the options of the current configuration. + import ../../../doc/manual {inherit pkgs options;}; in diff --git a/release.nix b/release.nix index a07d36dfc150..a8f072165600 100644 --- a/release.nix +++ b/release.nix @@ -74,11 +74,11 @@ let import "${nixosSrc}/doc/manual" { pkgs = import nixpkgs {}; - optionDeclarations = + options = (import lib/eval-config.nix { inherit nixpkgs; modules = [ ]; - }).optionDeclarations; + }).options; };