From ad10d4fdef46a00bbe2d95aadc96b9e062fe0539 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sat, 29 Oct 2022 07:58:02 -0400 Subject: [PATCH] lib.modules.doRename: Don't define warning, even as undefined, if not warning. This fixes mkAliasOptionModule in systems with no warning option. --- lib/modules.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/modules.nix b/lib/modules.nix index a7fbec93a2f5..204a2cc1ac12 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -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)