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

This fixes mkAliasOptionModule in systems with no warning option.

Changed files
+2 -2
lib
+2 -2
lib/modules.nix
···
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)