lib.modules.doRename: Don't define warning, even as undefined, if not warning.

This fixes mkAliasOptionModule in systems with no warning option.
This commit is contained in:
Shea Levy 2022-10-29 07:58:02 -04:00 committed by Robert Hensing
parent afddc087d9
commit ad10d4fdef

View File

@ -1135,10 +1135,10 @@ rec {
type = toType;
});
config = mkMerge [
{
(optionalAttrs (options ? warnings) {
warnings = optional (warn && fromOpt.isDefined)
"The option `${showOption from}' defined in ${showFiles fromOpt.files} has been renamed to `${showOption to}'.";
}
})
(if withPriority
then mkAliasAndWrapDefsWithPriority (setAttrByPath to) fromOpt
else mkAliasAndWrapDefinitions (setAttrByPath to) fromOpt)