diff options
author | Linnnus <[email protected]> | 2023-10-27 14:16:14 +0200 |
---|---|---|
committer | Linnnus <[email protected]> | 2023-10-27 14:16:14 +0200 |
commit | fd50b381d63e4875185289e8b6f27934aa97cd0d (patch) | |
tree | c4891c28ecdac14ceafdf0c29ec7ee5b295041f6 /home | |
parent | 14d07c33274e608103c013b7564899b346efd531 (diff) |
home/neovim/lsp: Enable autofetch for nil
Diffstat (limited to 'home')
-rw-r--r-- | home/neovim/lsp.nix | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/home/neovim/lsp.nix b/home/neovim/lsp.nix index 3aa3094..0870358 100644 --- a/home/neovim/lsp.nix +++ b/home/neovim/lsp.nix @@ -1,11 +1,7 @@ # This module sets up LSP server configurations for Neovim. It is waaay # overcomplicated as it kind of turned into an experiment in generating Lua # code from a Nix attrset. -{ - pkgs, - lib, - ... -}: { +{pkgs, ...}: { programs.neovim.plugins = [ { plugin = pkgs.vimPlugins.nvim-lspconfig; @@ -53,7 +49,24 @@ -- map buffer local keybindings when the language server attaches local servers = { pyright = { cmd = { "${pkgs.pyright}/bin/pyright-langserver", "--stdio" } }, - nil_ls = { cmd = { "${pkgs.nil}/bin/nil" } }, + nil_ls = { + cmd = { "${pkgs.nil}/bin/nil" }, + settings = { + ["nil"] = { + formatting = { + command = {"nix", "run", "nixpkgs#alejandra"}, + }, + nix = { + flake = { + -- calls `nix flake archive` to put a flake and its output to store + autoArchive = true, + -- auto eval flake inputs for improved completion + autoEvalInputs = true, + }, + }, + }, + }, + }, denols = { init_options = { enable = true, @@ -73,9 +86,9 @@ end end, }, - clangd = { - cmd = { "${pkgs.clang-tools}/bin/clangd" }, - }, + clangd = { + cmd = { "${pkgs.clang-tools}/bin/clangd" }, + }, }; for server, config in pairs(servers) do -- set common options |