lib/deprecation: expose mkSettingsRenamedOptionModules publicly

Extracted the `optionsRenamedToSettings` implementation
from`mkVimPlugin` and `mkNeovimPlugin` into a new public helper.
This commit is contained in:
Austin Horstman 2024-08-13 09:23:17 -05:00 committed by GaetanLepage
parent e3ec1c4a46
commit db4c4e5b17
4 changed files with 20 additions and 19 deletions

View file

@ -46,6 +46,18 @@ rec {
'';
};
mkSettingsRenamedOptionModules =
oldPrefix: newPrefix:
map (
option':
let
option = toList option';
oldPath = oldPrefix ++ option;
newPath = newPrefix ++ map nixvim.toSnakeCase option;
in
mkRenamedOptionModule oldPath newPath
);
# A clone of types.coercedTo, but it prints a warning when oldType is used.
transitionType =
oldType: coerceFn: newType: