neovim: change the plugin default type from viml -> lua

When introduced the neovim lua API was not as good as it is today.
I suspect the majority of users now default to lua rather than viml so
let's default to it.
This commit is contained in:
teto 2026-03-30 17:41:51 +02:00 committed by Austin Horstman
parent a91f37efba
commit 7f6c5834ca
2 changed files with 58 additions and 1 deletions

View file

@ -0,0 +1,41 @@
{ config, pkgs, ... }:
{
time = "2026-04-01T20:28:19+00:00";
condition = config.programs.neovim.enable;
# if behavior changed, explain how to restore previous behavior.
message = ''
We are changing neovim plugin "config" default type from `viml` to `lua`.
When the option was introduced neovim lua support was not as popular or robust as in 0.12.
Lua configuration seems to be the most popular these days so starting from 26.05, neovim default
plugin "config" is assumed to be written as lua instead of viml.
You may see the following warning:
evaluation warning: The default value of `programs.neovim.plugins.PLUGIN.type` has changed from `"viml"` to `"lua"`.
You are currently using the legacy default (`"viml"`) because `home.stateVersion` is less than "26.05".
To silence this warning and keep legacy behavior, set:
programs.neovim.plugins.PLUGIN.type = "viml";
To adopt the new default behavior, set:
programs.neovim.plugins.PLUGIN.type = "lua";
which can be triggered for instance by:
programs.neovim.plugins = [
{ plugin = vimPlugins.fugitive-vim; }
];
Fix it with:
programs.neovim.plugins = [
{ plugin = vimPlugins.fugitive-vim; type = "viml"; }
];
or
programs.neovim.plugins = [
vimPlugins.fugitive-vim
];
'';
}

View file

@ -282,7 +282,23 @@ in
"fennel"
]) types.str;
description = "Language used in config. Configurations are aggregated per-language.";
default = "viml";
inherit
(lib.hm.deprecations.mkStateVersionOptionDefault {
inherit (config.home) stateVersion;
optionPath = [
"programs"
"neovim"
"plugins"
"PLUGIN"
"type"
];
since = "26.05";
legacy.value = "viml";
current.value = "lua";
})
default
defaultText
;
};
optional = mkEnableOption "optional" // {