lib/plugins: make plugin optional when lazy-loading

This commit is contained in:
Heitor Augusto 2024-12-26 07:13:32 -03:00 committed by nix-infra-bot
parent 87b2679d6f
commit f878289722
5 changed files with 22 additions and 1 deletions

View file

@ -381,5 +381,18 @@ rec {
}
);
};
mkAutoLoadOption =
cfg: name:
lib.mkOption {
description = ''
Whether to automatically load ${name} when neovim starts.
'';
type = types.bool;
default = !(cfg.lazyLoad.enable or false);
defaultText =
if cfg ? lazyLoad then lib.literalMD "`false` when lazy-loading is enabled." else true;
example = false;
};
}
// removed