about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2022-10-29 07:58:02 -0400
committerRobert Hensing <robert@roberthensing.nl>2022-11-03 13:12:58 +0100
commitad10d4fdef46a00bbe2d95aadc96b9e062fe0539 (patch)
tree7158528add89a37663d8e1bf28782cb7132ccf0a /lib
parentafddc087d9d24eac691bb9875659d3bb4dc02cdd (diff)
lib.modules.doRename: Don't define warning, even as undefined, if not warning.
This fixes mkAliasOptionModule in systems with no warning option.
Diffstat (limited to 'lib')
-rw-r--r--lib/modules.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index a7fbec93a2f51..204a2cc1ac12a 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)