1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 19:46:06 +01:00
nixvim/plugins/by-name/startup/deprecations.nix
saygo-png e2823e7309 plugins/startup: migrate to mkNeovimPlugin
Signed-off-by: saygo-png <saygo.mail@proton.me>
2025-10-18 18:29:06 +00:00

50 lines
1.1 KiB
Nix

lib: {
deprecateExtraOptions = true;
optionsRenamedToSettings = map (lib.splitString ".") [
"theme"
"options.mappingKeys"
"options.cursorColumn"
"options.after"
"options.emptyLinesBetweenMappings"
"options.disableStatuslines"
"options.paddings"
"mappings.executeCommand"
"mappings.openFile"
"mappings.openFileSplit"
"mappings.openSection"
"mappings.openHelp"
"colors.background"
"colors.foldedSection"
"parts"
];
imports = [
(
let
inherit (lib) mapAttrs mapAttrs' nameValuePair;
inherit (lib.nixvim) ifNonNull' toSnakeCase;
basePathAnd = lib.concat [
"plugins"
"startup"
];
oldOptPath = basePathAnd [ "sections" ];
in
lib.mkChangedOptionModule oldOptPath
(basePathAnd [
"settings"
])
(
config:
let
old = lib.getAttrFromPath oldOptPath config;
in
ifNonNull' old (mapAttrs (_: (mapAttrs' (n: nameValuePair (toSnakeCase n)))) old)
)
)
];
}