Commit graph

12 commits

Author SHA1 Message Date
Stanislav Asunkin
404e56066f 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.
2025-05-12 17:39:01 +03:00
Stanislav Asunkin
7bb135b091 Revert "modules/performance: temporary add plenary to extraPlugins to fix tests"
This reverts commit 5a491f4b2b.
2025-04-28 17:26:13 +03:00
Matt Sturgeon
47f44488ae
modules/performance: document pathsToLink default
We set the default with "normal" priority, so explicitly list it as
`defaultText`.
2025-04-26 19:55:38 +01:00
Matt Sturgeon
6418cf3414
modules/performance: update runtimepath pathsToLink 2025-04-26 19:55:38 +01:00
Gaetan Lepage
5a491f4b2b modules/performance: temporary add plenary to extraPlugins to fix tests 2025-04-01 16:03:03 +02:00
Stanislav Asunkin
9314cd46f0 modules/performance: add ability to byte compile nvim runtime directory
This commit adds `performance.byteCompileLua.nvimRuntime` toggle that,
if enabled, byte compiles all lua files in Nvim runtime directory.
2024-07-31 11:31:40 +00:00
Stanislav Asunkin
55ca9d235b modules/performance: add ability to byte compile lua plugins
This commit adds `performance.byteCompileLua.plugins` toggle that, if
enabled, byte compiles all lua files in plugins
2024-07-31 11:31:40 +00:00
Stanislav Asunkin
44849233e0 modules/performance: add ability to byte compile lua configuration files
This commit adds support for byte compiling lua configuration files.
It's enabled by default (if byte compiling is enabled at all) and can be
disabled with `performance.byteCompileLua.configs` toggle.

To implement this feature `extraFiles.<name>.finalSource` internal
read-only option is introduced. `source` option cannot be used because
it's user configurable. In order to access the values of the
`performance.byteCompileLua` options, parent config is added to
specialArgs of extraFiles submodule. Then the usages of `source` option
changed to `finalSource` in all relevant places (filesPlugin and
wrappers).

Added more helpers for various cases of byte compiling:

* `byteCompileLuaFile` byte compiles lua file
* `byteCompileLuaHook` is a setup hook that byte compiles all lua files
* `byteCompileLuaDrv` overrides derivation by adding byteCompileLuaHook
  to it

Added tests to validate that extraFiles specified by various methods are
handled correctly. Added a separate home-manager test, that is intended
to validate that extraFiles propagated to wrapper modules are correctly
byte compiled.
2024-07-31 11:31:40 +00:00
Stanislav Asunkin
17e8904992 modules/performance: add performance.byteCompileLua option
* add `performance.byteCompileLua.enable` toggle to enable or disable
  all byte compiling features
* add `performance.byteCompileLua.initLua` toggle to enable or
  disable byte compiling of init.lua
* add `writeByteCompiledLua` helper for saving byte compiled lua source
  code to the nix store
* `nixvim-print-init` utility is always pointed to uncompiled init.lua
* add tests
2024-07-31 11:31:40 +00:00
Stanislav Asunkin
6e2ec5ed02 modules/performance: add plenary filetypes directory to default pathsToLink
plenary.nvim is often pulled as a dependency of other plugins.
It has filetype definitions in `data/plenary/filetypes` directory.
Even though I don't think there are plugins using it instead of
vim.filetype, but it should be no harm to add this directory by default.
2024-07-24 16:50:50 +02:00
Stanislav Asunkin
e65c9590d0 modules/performance: add combinePlugins.standalonePlugins option 2024-07-24 16:50:50 +02:00
Stanislav Asunkin
fdb3950c59 modules/performance: add an option to combine plugins to a single plugin pack 2024-07-24 16:50:50 +02:00