mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-23 20:25:08 +02:00
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
This commit is contained in:
parent
3789c69658
commit
17e8904992
4 changed files with 183 additions and 2 deletions
|
@ -206,7 +206,17 @@ in
|
|||
config.content
|
||||
];
|
||||
|
||||
init = helpers.writeLua "init.lua" customRC;
|
||||
textInit = helpers.writeLua "init.lua" customRC;
|
||||
byteCompiledInit = helpers.writeByteCompiledLua "init.lua" customRC;
|
||||
init =
|
||||
if
|
||||
config.type == "lua"
|
||||
&& config.performance.byteCompileLua.enable
|
||||
&& config.performance.byteCompileLua.initLua
|
||||
then
|
||||
byteCompiledInit
|
||||
else
|
||||
textInit;
|
||||
|
||||
extraWrapperArgs = builtins.concatStringsSep " " (
|
||||
(optional (
|
||||
|
@ -232,7 +242,7 @@ in
|
|||
name = "nixvim-print-init";
|
||||
runtimeInputs = [ pkgs.bat ];
|
||||
text = ''
|
||||
bat --language=lua "${init}"
|
||||
bat --language=lua "${textInit}"
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue