Add mkOverrideTemplate (currently the same as mkOverride).

svn path=/nixpkgs/trunk/; revision=17737
This commit is contained in:
Nicolas Pierron 2009-10-09 18:11:36 +00:00
parent bb16a7f08d
commit d11481e9bf

View File

@ -288,7 +288,7 @@ rec {
# priorities are kept. The template argument must reproduce the same
# attribute set hierarchy to override leaves of the hierarchy.
isOverride = attrs: (typeOf attrs) == "override";
mkOverride = priority: template: content: mkProperty {
mkOverrideTemplate = priority: template: content: mkProperty {
property = {
_type = "override";
onDelay = onOverrideDelay;
@ -298,6 +298,10 @@ rec {
inherit content;
};
# Currently an alias, but sooner or later the template argument should be
# removed.
mkOverride = mkOverrideTemplate;
# Sugar to override the default value of the option by making a new
# default value based on the configuration.
mkDefaultValue = content: mkOverride 1000 {} content;