From 356a88a5746791806e864db80143462b81ce433b Mon Sep 17 00:00:00 2001 From: teto <886074+teto@users.noreply.github.com> Date: Thu, 22 Jan 2026 21:13:20 +0100 Subject: [PATCH] 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. --- modules/programs/neovim.nix | 15 +++++++++++---- tests/modules/programs/neovim/extra-lua-init.nix | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index 641b70f0..85eafaa1 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -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 { diff --git a/tests/modules/programs/neovim/extra-lua-init.nix b/tests/modules/programs/neovim/extra-lua-init.nix index b939452e..41ac3d5a 100644 --- a/tests/modules/programs/neovim/extra-lua-init.nix +++ b/tests/modules/programs/neovim/extra-lua-init.nix @@ -4,15 +4,15 @@ programs.neovim = { enable = true; - extraLuaConfig = '' - -- extraLuaConfig + initLua = '' + -- initLua ''; }; nmt.script = '' nvimFolder="home-files/.config/nvim" assertFileContent "$nvimFolder/init.lua" ${builtins.toFile "init.lua-expected" '' - -- extraLuaConfig + -- initLua ''} ''; }