nix-community.nixvim/modules/lazyload.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
573 B
Nix
Raw Normal View History

{
config,
lib,
...
}:
let
implementations = [
"lz-n"
"lazy"
];
in
{
config = {
assertions =
let
enabled = builtins.filter (x: config.plugins.${x}.enable) implementations;
count = builtins.length enabled;
in
[
{
assertion = count < 2;
message = ''
You have multiple lazy-loaders enabled:
${lib.concatImapStringsSep "\n" (i: x: "${toString i}. plugins.${x}") enabled}
Please ensure only one is enabled at a time.
'';
}
];
};
}