diff --git a/modules/default.nix b/modules/default.nix index 739a30db..49c2ddf6 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -16,6 +16,7 @@ ./filetype.nix ./highlights.nix ./keymaps.nix + ./lazyload.nix ./lua-loader.nix ./opts.nix ./output.nix diff --git a/modules/lazyload.nix b/modules/lazyload.nix new file mode 100644 index 00000000..17bb325f --- /dev/null +++ b/modules/lazyload.nix @@ -0,0 +1,30 @@ +{ + 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. + ''; + } + ]; + }; +}