Skip to content

Commit

Permalink
fix(nix): Actually use nixd LSP (#1101)
Browse files Browse the repository at this point in the history
* fix(nix): Actually use nixd LSP

In 44e8c95 an isssue with trying to
install nixd via mason was fixed, by removing nixd from required mason
packages and instead adding it as a required dependency for the pack,
that should be present in the PATH.

However, normally, mason would've also registered nixd to lspconfig, but
since mason isn't being used, nixd LSP was never registered, making this
requirement pointless.

This actually registers nixd languge server through astrolsp plugin.

* Update lua/astrocommunity/pack/nix/init.lua

Co-authored-by: Micah Halter <[email protected]>

* fix(nix): correct bad none-ls configuration

---------

Co-authored-by: Micah Halter <[email protected]>
  • Loading branch information
ItsDrike and mehalter authored Jul 9, 2024
1 parent bd09782 commit eece4c6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lua/astrocommunity/pack/nix/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ return {
"nvimtools/none-ls.nvim",
optional = true,
opts = function(_, opts)
local nls = require "null-ls"
if type(opts.sources) == "table" then
vim.list_extend(opts.sources, {
nls.builtins.code_actions.statix,
nls.builtins.formatting.alejandra,
nls.builtins.diagnostics.deadnix,
})
end
local builtins = require("null-ls").builtins
opts.sources = require("astrocore").list_insert_unique(opts.sources, {
builtins.code_actions.statix,
builtins.formatting.alejandra,
builtins.diagnostics.deadnix,
})
end,
},
{
"AstroNvim/astrolsp",
opts = function(_, opts) opts.servers = require("astrocore").list_insert_unique(opts.servers, { "nixd" }) end,
},
{
"stevearc/conform.nvim",
optional = true,
Expand Down

0 comments on commit eece4c6

Please sign in to comment.