Skip to content

Commit 76b567b

Browse files
committed
modules/lazyload: warn enabling a lazy loading provider
1 parent 0997b37 commit 76b567b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

modules/lazyload.nix

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,33 @@ in
2626
'';
2727
}
2828
];
29+
warnings =
30+
let
31+
ignoredPackages = [
32+
# removed
33+
"treesitter-playground"
34+
# renamed
35+
"surround"
36+
"null-ls"
37+
"wilder-nvim"
38+
];
39+
40+
pluginsWithLazyLoad = builtins.filter (
41+
x:
42+
!(lib.elem x ignoredPackages)
43+
&& lib.hasAttr "lazyLoad" config.plugins.${x}
44+
&& config.plugins.${x}.lazyLoad.enable
45+
) (builtins.attrNames config.plugins);
46+
count = builtins.length pluginsWithLazyLoad;
47+
in
48+
lib.optionals (count > 0 && !config.plugins.lz-n.enable) [
49+
''
50+
You have enabled lazy loading support for the following plugins but have not enabled a lazy loading provider.
51+
${lib.concatImapStringsSep "\n" (i: x: "${toString i}. plugins.${x}") pluginsWithLazyLoad}
52+
53+
Currently supported lazy providers:
54+
- lz-n
55+
''
56+
];
2957
};
3058
}

0 commit comments

Comments
 (0)