nvim/lua/plugins/nix.lua

71 lines
2.2 KiB
Lua
Raw Normal View History

2024-06-17 15:22:39 +07:00
return {
2024-10-24 20:18:59 +07:00
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"nix",
"css",
"bash",
"hyprlang",
},
},
},
2024-06-17 15:22:39 +07:00
{
2024-10-21 21:32:20 +07:00
"nvim-lspconfig",
opts = {
servers = {
2024-10-24 20:18:59 +07:00
nixd = {
2024-10-21 21:32:20 +07:00
settings = {
2024-10-24 20:18:59 +07:00
nixd = {
nixpkgs = {
expr = "import <nixpkgs> {}",
2024-10-21 21:32:20 +07:00
},
2024-10-24 20:18:59 +07:00
options = {
nixos = {
expr = (function()
local flake_path = vim.fn.expand "$HOME/dotfiles"
local handle = io.popen "hostname"
local hostname = handle:read "*a"
handle:close()
hostname = string.gsub(hostname, "\n", "")
local expr = [[(builtins.getFlake "%s").nixosConfigurations.%s.options]]
return string.format(expr, flake_path, hostname)
end)(),
2024-10-21 21:32:20 +07:00
},
},
},
},
},
},
},
},
{
"dundalek/lazy-lsp.nvim",
dependencies = { "neovim/nvim-lspconfig" },
opts = {
prefer_local = true,
excluded_servers = {
"gopls", -- gopls likes to be double attached if enabled here.
"bazelrc-lsp",
2024-10-24 20:18:59 +07:00
"nil_ls",
2024-10-21 21:32:20 +07:00
},
preferred_servers = {
gitcommit = {},
sql = {},
nix = {
2024-10-24 20:18:59 +07:00
-- "nil_ls",
"nixd",
2024-10-21 21:32:20 +07:00
},
typescript = {
"tsserver",
},
proto = {
"buf-language-server",
},
sh = {},
markdown = {},
},
},
2024-06-17 15:22:39 +07:00
},
}