feat: nil_ls setup

This commit is contained in:
punkfairie 2025-03-02 09:53:12 -08:00
parent 8a48c56206
commit fe559c2214
Signed by: punkfairie
GPG key ID: B3C5488E9A1A7CA6
3 changed files with 38 additions and 0 deletions

View file

@ -25,10 +25,12 @@ local lazyOptions = {
-- argument, the path to lazy.nvim as downloaded by nix, or nil, before the normal arguments.
require('nixCatsUtils.lazyCat').setup(nixCats.pawsible { 'allPlugins', 'start', 'lazy.nvim' }, {
{ 'LazyVim/LazyVim', import = 'lazyvim.plugins' },
-- disable mason.nvim while using nix
-- precompiled binaries do not agree with nixos, and we can just make nix install this stuff for us.
{ 'williamboman/mason-lspconfig.nvim', enabled = require('nixCatsUtils').lazyAdd(true, false) },
{ 'williamboman/mason.nvim', enabled = require('nixCatsUtils').lazyAdd(true, false) },
{
'nvim-treesitter/nvim-treesitter',
build = require('nixCatsUtils').lazyAdd ':TSUpdate',
@ -40,6 +42,7 @@ require('nixCatsUtils.lazyCat').setup(nixCats.pawsible { 'allPlugins', 'start',
auto_install = require('nixCatsUtils').lazyAdd(true, false),
},
},
{
'folke/lazydev.nvim',
ft = 'lua',
@ -50,6 +53,10 @@ require('nixCatsUtils.lazyCat').setup(nixCats.pawsible { 'allPlugins', 'start',
},
},
},
-- extras
{ import = 'lazyvim.plugins.extras.lang.nix' },
-- import/override with your plugins
{ import = 'plugins' },
}, lazyOptions)

View file

@ -0,0 +1,12 @@
return {
{
'stevearc/conform.nvim',
---@class ConformOpts
opts = {
formatters_by_ft = {
nix = { 'alejandra' },
},
},
},
}

View file

@ -0,0 +1,19 @@
return {
{
'neovim/nvim-lspconfig',
opts = {
servers = {
nil_ls = {
settings = {
['nil'] = {
flake = {
autoArchive = true,
autoEvalInputs = true,
},
},
},
},
},
},
},
}