pkg(nixvim): Remove all lang configuration to single file

This commit is contained in:
ulic-youthlic 2025-07-13 06:04:55 +08:00
parent 54d4bc057e
commit 7477166d9e
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
10 changed files with 21 additions and 10 deletions

34
pkgs/nixvim/lang/lua.nix Normal file
View file

@ -0,0 +1,34 @@
{
lib,
pkgs,
...
}: {
lsp.servers.lua_ls = {
enable = true;
};
youthlic.plugins.conform-nvim.settings = {
formatters_by_ft.lua = {
__unkeyed-1 = "stylua";
lsp_format = "fallback";
};
formatters.stylua = {
__raw =
#lua
''
function()
local defaultFormatter = require("conform.formatters.stylua")
return vim.tbl_extend("force", defaultFormatter, {
command = function()
local exe = vim.fn["exepath"]("stylua")
if exe ~= "" then
return exe
else
return "${lib.getExe pkgs.stylua}"
end
end
})
end
'';
};
};
}