Use only one merge to compute option definitions and option declarations.
svn path=/nixos/trunk/; revision=17165
This commit is contained in:
parent
36573e5e5c
commit
dd40d6196b
@ -19,10 +19,12 @@ rec {
|
|||||||
configComponents = modules ++ baseModules;
|
configComponents = modules ++ baseModules;
|
||||||
|
|
||||||
# Merge the option definitions in all modules, forming the full
|
# Merge the option definitions in all modules, forming the full
|
||||||
# system configuration. This is called "configFast" because it's
|
# system configuration. It's not checked for undeclared options.
|
||||||
# not checked for undeclared options.
|
systemModule =
|
||||||
configFast =
|
pkgs.lib.fixMergeModules configComponents extraArgs;
|
||||||
pkgs.lib.definitionsOf configComponents extraArgs;
|
|
||||||
|
optionDefinitions = systemModule.config;
|
||||||
|
optionDeclarations = 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.
|
||||||
@ -53,19 +55,12 @@ rec {
|
|||||||
# define nixpkgs.config, so it's pointless to evaluate them.
|
# define nixpkgs.config, so it's pointless to evaluate them.
|
||||||
baseModules = [ ../modules/misc/nixpkgs.nix ];
|
baseModules = [ ../modules/misc/nixpkgs.nix ];
|
||||||
pkgs = import nixpkgs { inherit system; config = {}; };
|
pkgs = import nixpkgs { inherit system; config = {}; };
|
||||||
}).configFast.nixpkgs.config;
|
}).optionDefinitions.nixpkgs.config;
|
||||||
};
|
};
|
||||||
|
|
||||||
# "fixableDeclarationsOf" is used instead of "declarationsOf" because some
|
|
||||||
# option default values may depends on the definition of other options.
|
|
||||||
# !!! This seems inefficent. Didn't definitionsOf already compute
|
|
||||||
# the option declarations?
|
|
||||||
optionDeclarations =
|
|
||||||
pkgs.lib.fixableDeclarationsOf configComponents extraArgs configFast;
|
|
||||||
|
|
||||||
# Optionally check wether all config values have corresponding
|
# Optionally check wether all config values have corresponding
|
||||||
# option declarations.
|
# option declarations.
|
||||||
config = pkgs.checker configFast
|
config = pkgs.checker optionDefinitions
|
||||||
configFast.environment.checkConfigurationOptions
|
optionDefinitions.environment.checkConfigurationOptions
|
||||||
optionDeclarations configFast;
|
optionDeclarations optionDefinitions;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user