mkRemovedOptionModule: assert on removed options (#69419)

mkRemovedOptionModule: assert on removed options
This commit is contained in:
Silvan Mosberger
2019-09-30 16:39:40 +02:00
committed by GitHub
3 changed files with 9 additions and 6 deletions
+7 -4
View File
@@ -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