lib.mkRemovedOptionModule: Show replacement for option usage too

Previously mkRemovedOptionModule would only show the replacement
instructions when the removed option was *defined*. With this change, it
also does so when an option is *used*.

This is essential for options that are only intended to be used such as
`security.acme.directory`, whose replacement instructions would never
trigger without this change because almost everybody only uses the
option and isn't defining it.
wip/yesman
Silvan Mosberger 5 years ago
parent 07ca91187c
commit ebb136da9f
No known key found for this signature in database
GPG Key ID: 9424360B4B85C9E7
  1. 1
      lib/modules.nix

@ -591,6 +591,7 @@ rec {
{ options, ... }:
{ options = setAttrByPath optionName (mkOption {
visible = false;
apply = x: throw "The option `${showOption optionName}' can no longer be used since it's been removed. ${replacementInstructions}";
});
config.warnings =
let opt = getAttrFromPath optionName options; in

Loading…
Cancel
Save