modules/performance: ensure dependencies of lua packages also compiled

Previously only extraLuaPackages themselves were byte-compiled, not
theirs dependencies. This commit fixes that by compiling lua packages
recursively. It uses byte-compile-lua-lib.nix shared file.
Also this commit uses the shared stub lua libraries for extraLuaPackages
byte-compiling test.
This commit is contained in:
Stanislav Asunkin 2025-05-11 12:30:50 +03:00
parent 9474ce916a
commit 75f2c1b1f1
4 changed files with 23 additions and 20 deletions

View file

@ -172,9 +172,10 @@ in
config =
let
# Optionally byte compile lua library
inherit (import ./plugins/byte-compile-lua-lib.nix { inherit lib pkgs; }) byteCompileLuaPackages;
extraLuaPackages =
if config.performance.byteCompileLua.enable && config.performance.byteCompileLua.luaLib then
ps: map builders.byteCompileLuaDrv (config.extraLuaPackages ps)
ps: byteCompileLuaPackages (config.extraLuaPackages ps)
else
config.extraLuaPackages;