@@ -592,11 +592,14 @@ rec {
592592 { options = setAttrByPath optionName (mkOption {
593593 visible = false;
594594 });
595− config.warnings =
596− let opt = getAttrFromPath optionName options; in
597− optional opt.isDefined ''
595+ config.assertions =
596+ let opt = getAttrFromPath optionName options; in [{
597+ assertion = !opt.isDefined;
598+ message = ''
598599 The option definition `${showOption optionName}' in ${showFiles opt.files} no longer has any effect; please remove it.
599− ${replacementInstructions}'';
600+ ${replacementInstructions}
601+ '';
602+ }];
600603 };
601604
602605 /* Return a module that causes a warning to be shown if the