Commit graph

8 commits

Author SHA1 Message Date
Stanislav Asunkin
65d35db5ca modules/performance: fix specifying combinePlugin.standalonePlugins as packages when byte compilation enabled
Previously, specifying plugins as packages in the
`performance.combinePlugins.standalonePlugins` option did not work when
the `performance.byteCompileLua` option was also enabled. This issue was
due to several package transformations performed by the
`byteCompileLua` which broke package comparison.

There are at least three methods to fix the issue:

- Change transformation order: combine plugins first, then byte-compile
  them.
- Compare every possible transformation when determining if plugins are
  standalone.
- Get the name of the package and use it for comparison.

The first method did not work because the current `byteCompileLuaDrv`
implementation does not support symlinks to directories. The second
method appears too fragile. This commit implements the third method, as
it requires minimal code changes and is straightforward. The downside is
that it might exclude multiple packages with the same name, although
this should be rare.
2025-06-02 18:15:32 +03:00
Stanislav Asunkin
49a7bb573a modules/top-level: change usages of import to callPackage 2025-05-12 17:39:01 +03:00
Stanislav Asunkin
75f2c1b1f1 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.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
9474ce916a modules/performance: ensure all lua dependencies are byte-compiled
This commit replaces custom lua plugins in tests with shared stub
plugins from utils module.
After this change the test has started to fail. Debugging this issue
I found out that dependencies of plugins weren't processed.
This commit improves the test assertion to detect duplicated
dependencies in this case and fixes the underlying issue by also
processing dependencies.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
0d78a47792 modules/top-level/plugins: use mapNormalizedPlugins utils function 2025-05-12 17:39:01 +03:00
Stanislav Asunkin
2c6182351f modules/performance: add ability to byte-compile plugin lua dependencies
This commit adds byte compiling of plugin lua dependencies
(specifically propagatedBuildInputs). It's enabled by
`performance.byteCompileLua.luaLib` option.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
f28d384ab5 modules/performance/combine-plugins: propagate lua dependencies
Plugins from luarocks (e.g. telescope-nvim) have dependencies specified
in propagatedBuildInputs. These dependencies are not added as plugins in
Nvim runtime. They are added to LUA_PATH env var for wrapped neovim.
This commit collects all propagatedBuildInputs from input plugin list
and puts them in the combined plugin.
Note that such dependencies are never combined, because they are not
plugins.
2025-04-28 17:26:13 +03:00
Gaetan Lepage
efb24d78bd modules: refactor plugins code in top-level 2025-04-01 15:43:26 +02:00