Replace optionDeclarations by options which is directly computed by

moduleMerge.

svn path=/nixos/trunk/; revision=17166
This commit is contained in:
Nicolas Pierron 2009-09-15 14:09:18 +00:00
parent dd40d6196b
commit 10e9705a86
4 changed files with 15 additions and 21 deletions

View file

@ -1,23 +1,17 @@
{ pkgs, optionDeclarations }: { pkgs, options }:
let let
manualConfig =
{ environment.checkConfigurationOptions = false;
services.nixosManual.enable = false;
};
# To prevent infinite recursion, remove system.path from the # To prevent infinite recursion, remove system.path from the
# options. Not sure why this happens. # options. Not sure why this happens.
optionDeclarations_ = options_ =
optionDeclarations // options //
{ system = removeAttrs optionDeclarations.system ["path"]; }; { system = removeAttrs options.system ["path"]; };
options = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext optionsXML = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext
(builtins.toXML (pkgs.lib.optionAttrSetToDocList "" optionDeclarations_))); (builtins.toXML (pkgs.lib.optionAttrSetToDocList "" options_)));
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} ${optionsXML}
''; '';
manual = pkgs.stdenv.mkDerivation { manual = pkgs.stdenv.mkDerivation {

View file

@ -25,11 +25,12 @@ rec {
optionDefinitions = systemModule.config; optionDefinitions = systemModule.config;
optionDeclarations = systemModule.options; optionDeclarations = systemModule.options;
inherit (systemModule) options;
# These are the extra arguments passed to every module. In # These are the extra arguments passed to every module. In
# particular, Nixpkgs is passed through the "pkgs" argument. # particular, Nixpkgs is passed through the "pkgs" argument.
extraArgs = extraArgs_ // { extraArgs = extraArgs_ // {
inherit pkgs optionDeclarations; inherit pkgs;
modulesPath = ../modules; modulesPath = ../modules;
servicesPath = services; servicesPath = services;
}; };
@ -62,5 +63,5 @@ rec {
# option declarations. # option declarations.
config = pkgs.checker optionDefinitions config = pkgs.checker optionDefinitions
optionDefinitions.environment.checkConfigurationOptions optionDefinitions.environment.checkConfigurationOptions
optionDeclarations optionDefinitions; options optionDefinitions;
} }

View file

@ -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, optionDeclarations, ...}: {pkgs, config, options, ...}:
let let
@ -13,9 +13,8 @@ let
manual = manual =
# 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 options of the current configuration.
# configuration. import ../../../doc/manual {inherit pkgs options;};
import ../../../doc/manual {inherit pkgs optionDeclarations;};
in in

View file

@ -74,11 +74,11 @@ let
import "${nixosSrc}/doc/manual" { import "${nixosSrc}/doc/manual" {
pkgs = import nixpkgs {}; pkgs = import nixpkgs {};
optionDeclarations = options =
(import lib/eval-config.nix { (import lib/eval-config.nix {
inherit nixpkgs; inherit nixpkgs;
modules = [ ]; modules = [ ];
}).optionDeclarations; }).options;
}; };