neovim: rename extraLuaConfig to initLua

Now that the whole lua config is exposed via the extraLuaConfig option,
it's not "extra" anymore but the whole content. Renaming it to "initLua"
is more adequate and it makes the option more understandable I hope.
This commit is contained in:
teto 2026-01-22 21:13:20 +01:00 committed by Matthieu Coudron
parent d055b309a6
commit 356a88a574
2 changed files with 14 additions and 7 deletions

View file

@ -35,6 +35,13 @@ in
{
meta.maintainers = with lib.maintainers; [ khaneliman ];
imports = [
(lib.mkRenamedOptionModule
[ "programs" "neovim" "extraLuaConfig" ]
[ "programs" "neovim" "initLua" ]
)
];
options = {
programs.neovim = {
enable = mkEnableOption "Neovim";
@ -211,7 +218,7 @@ in
'';
};
extraLuaConfig = mkOption {
initLua = mkOption {
type = types.lines;
default = "";
example = lib.literalExpression ''
@ -488,7 +495,7 @@ in
programs.neovim.extraConfig = lib.concatStringsSep "\n" vimPackageInfo.userPluginViml;
programs.neovim.extraPackages = mkIf cfg.autowrapRuntimeDeps vimPackageInfo.runtimeDeps;
programs.neovim.extraLuaConfig =
programs.neovim.initLua =
let
# using default 'foldmarker', to be used with foldmethod=marker
foldedLuaBlock =
@ -543,8 +550,8 @@ in
(map (x: x.runtime) pluginsNormalized)
++ [
{
"nvim/init.lua" = mkIf (cfg.extraLuaConfig != "") {
text = cfg.extraLuaConfig;
"nvim/init.lua" = mkIf (cfg.initLua != "") {
text = cfg.initLua;
};
"nvim/coc-settings.json" = mkIf cfg.coc.enable {