modules/performance: add ability to byte compile extraLuaPackages

This commit adds `performance.byteCompileLua.luaLib` options. When
enabled it byte-compiles lua packages from extraLuaPackages option.
This commit is contained in:
Stanislav Asunkin 2025-05-03 18:25:49 +03:00
parent fac192c022
commit 404e56066f
3 changed files with 64 additions and 9 deletions

View file

@ -57,6 +57,9 @@ in
nvimRuntime = lib.mkEnableOption "nvimRuntime" // {
description = "Whether to byte compile lua files in Nvim runtime.";
};
luaLib = lib.mkEnableOption "luaLib" // {
description = "Whether to byte compile lua library.";
};
};
combinePlugins = {

View file

@ -171,11 +171,18 @@ in
config =
let
# Optionally byte compile lua library
extraLuaPackages =
if config.performance.byteCompileLua.enable && config.performance.byteCompileLua.luaLib then
ps: map builders.byteCompileLuaDrv (config.extraLuaPackages ps)
else
config.extraLuaPackages;
neovimConfig = pkgs.neovimUtils.makeNeovimConfig (
{
inherit extraLuaPackages;
inherit (config)
extraPython3Packages
extraLuaPackages
viAlias
vimAlias
withRuby