modules/lazyload: warn enabling a lazy loading provider

This commit is contained in:
Austin Horstman 2024-12-07 16:45:18 -06:00
parent 0997b371c7
commit 76b567b43c
No known key found for this signature in database

View file

@ -26,5 +26,33 @@ in
'';
}
];
warnings =
let
ignoredPackages = [
# removed
"treesitter-playground"
# renamed
"surround"
"null-ls"
"wilder-nvim"
];
pluginsWithLazyLoad = builtins.filter (
x:
!(lib.elem x ignoredPackages)
&& lib.hasAttr "lazyLoad" config.plugins.${x}
&& config.plugins.${x}.lazyLoad.enable
) (builtins.attrNames config.plugins);
count = builtins.length pluginsWithLazyLoad;
in
lib.optionals (count > 0 && !config.plugins.lz-n.enable) [
''
You have enabled lazy loading support for the following plugins but have not enabled a lazy loading provider.
${lib.concatImapStringsSep "\n" (i: x: "${toString i}. plugins.${x}") pluginsWithLazyLoad}
Currently supported lazy providers:
- lz-n
''
];
};
}