36 lines
905 B
Nix
36 lines
905 B
Nix
{ pkgs, ... }:
|
|
{
|
|
programs.nixvim.extraPackages = with pkgs; [
|
|
stylua
|
|
nixfmt
|
|
];
|
|
|
|
programs.nixvim.plugins = {
|
|
conform-nvim = {
|
|
enable = true;
|
|
settings = {
|
|
format_on_save = ''
|
|
function(bufnr)
|
|
-- Disable "format_on_save lsp_fallback" for lanuages that don't
|
|
-- have a well standardized coding style. You can add additional
|
|
-- lanuages here or re-enable it for the disabled ones.
|
|
local disable_filetypes = { c = true, cpp = true }
|
|
if disable_filetypes[vim.bo[bufnr].filetype] then
|
|
return nil
|
|
else
|
|
return {
|
|
timeout_ms = 500,
|
|
lsp_format = "fallback",
|
|
}
|
|
end
|
|
end
|
|
'';
|
|
formatters_by_ft = {
|
|
lua = [ "stylua" ];
|
|
nix = [ "nixfmt" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|