autoformat nix files

change formatter alejandra -> nixfmt
reformat whole project
This commit is contained in:
Pim Kunis 2023-11-10 11:33:41 +01:00
parent 8772f38aed
commit bffcb3c95c
15 changed files with 143 additions and 211 deletions

View file

@ -1,4 +1,4 @@
{pkgs, ...}: {
{ pkgs, ... }: {
config = {
programs.neovim = {
enable = true;
@ -16,6 +16,7 @@
terraform-ls
luaformatter
efm-langserver
nixfmt
];
plugins = with pkgs.vimPlugins; [
@ -44,7 +45,7 @@
{
plugin = gitsigns-nvim;
type = "lua";
config = "require(\"gitsigns\").setup()";
config = ''require("gitsigns").setup()'';
}
{
plugin = nvim-cmp;

View file

@ -46,10 +46,14 @@ require'lspconfig'.terraformls.setup {
capabilities = capabilities
}
local luaformat = {formatCommand = "lua-format -i", formatStdin = true}
require'lspconfig'.efm.setup {
on_attach = require("lsp-format").on_attach,
init_options = {documentFormatting = true},
settings = {languages = {lua = {luaformat}}},
filetypes = {"lua"}
settings = {
languages = {
lua = {{formatCommand = "lua-format -i", formatStdin = true}},
nix = {{formatCommand = "nixfmt", formatStdin = true}}
}
},
filetypes = {"lua", "nix"}
}