Packages included:
dot-language-server
gopls
nim-language-server
bash-language-server
diagnostic-language-server
dockerfile-language-server
pyright
nix-language-server
rust-analyzer
solargraph
stylelint-language-server
terraform-language-server
typescript-language-server
vim-language-server
vscode-langservers-extracted
yaml-language-server
CLI tools (to be used with diagnostic-language-server
):
Add this repo to your flake.nix
inputs like:
{
# ...
inputs.lsp-nix.url = "github:thelonelyghost/lsp-nix";
# ...
outputs = { self, nixpkgs, flake-utils, lsp-nix, ...}@attrs:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
lsp = lsp-nix.packages."${system}";
in {
devShell = pkgs.mkShell {
nativeBuildInputs = [
pkgs.bashInteractive
lsp.dot-language-server
];
};
});
}
Updating: Anytime you want to update what lsp-nix offers, run nix flake lock --update-input lsp-nix
and rebuild your nix expression acccordingly.
If you're not yet using Nix Flakes, such as with home-manager
, here's how you can include it:
- Install
niv
and runniv init
- Run
niv add thelonelyghost/lsp-nix --name lsp-nix
- Include the following in your code:
{ lib, config, ... }:
let
sources = import ./nix/sources.nix {};
pkgs = import sources.nixpkgs {};
lsp = (import (pkgs.fetchFromGitHub { inherit (sources.lsp-nix) owner repo rev sha256; })).outputs.packages."${builtins.currentSystem}";
in
{
home.packages = [
lsp.dot-language-server
];
}
Updating: Anytime you want to update what lsp-nix offers, run niv update lsp-nix
and rebuild your nix expression acccordingly.