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

@ -1,9 +1,4 @@
/*
Byte compiling of lua dependencies of normalized plugin list
Inputs: List of normalized plugins
Outputs: List of normalized plugins with all the propagatedBuildInputs byte-compiled
*/
# Utilities for byte compiling of lua dependencies
{ lib, pkgs }:
let
builders = lib.nixvim.builders.withPkgs pkgs;
@ -40,4 +35,14 @@ let
# Byte-compile derivation (but only if it's a lua module) and its dependencies
byteCompile = drv: byteCompileDeps (mapLuaModule builders.byteCompileLuaDrv drv);
in
mapNormalizedPlugins byteCompileDeps
{
# byteCompilePluginDeps compiles propagatedBuildInputs recursively
# Inputs: List of normalized plugins
# Outputs: List of normalized plugins with all the propagatedBuildInputs byte-compiled
byteCompilePluginDeps = mapNormalizedPlugins byteCompileDeps;
# byteCompileLuaPackages compiles packages and its propagatedBuildInputs
# Inputs: List of lua packages
# Outputs: List of byte-compiled packages along with all the propagatedBuildInputs
byteCompileLuaPackages = map byteCompile;
}