diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/modules.nix | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/modules.nix b/lib/modules.nix index c3c903c1dfa8..00c7712487bd 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -592,11 +592,14 @@ rec { { options = setAttrByPath optionName (mkOption { visible = false; }); - config.warnings = - let opt = getAttrFromPath optionName options; in - optional opt.isDefined '' + config.assertions = + let opt = getAttrFromPath optionName options; in [{ + assertion = !opt.isDefined; + message = '' The option definition `${showOption optionName}' in ${showFiles opt.files} no longer has any effect; please remove it. - ${replacementInstructions}''; + ${replacementInstructions} + ''; + }]; }; /* Return a module that causes a warning to be shown if the |