Files
nvim/flake.nix
2026-05-04 14:05:28 +01:00

71 lines
1.6 KiB
Nix

{
description = "Neovim with LSP dev shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs }:
let
system = "x86_64-linux"; # change if needed
pkgs = import nixpkgs { inherit system; };
pkgList = with pkgs; [
# LSPs
lua-language-server
vscode-langservers-extracted
emmet-language-server
svelte-language-server
rust-analyzer
ast-grep
prettier
black
nixfmt
rustfmt
nil
python313Packages.python-lsp-server
typescript-language-server
tailwindcss-language-server
stylua
nixd
# other tools
lua5_1
tree-sitter
ripgrep
gcc
fzf
gnumake
imagemagick
luarocks
];
nvim-wrapped = pkgs.symlinkJoin {
name = "nvim-with-lsp";
paths = [ pkgs.neovim ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/nvim \
--prefix PATH : ${pkgs.lib.makeBinPath pkgList} \
--set TREE_SITTER_LIB_PATH "${pkgs.tree-sitter}/lib"
'';
};
in
{
packages.${system}.default = nvim-wrapped;
devShells.${system}.default = pkgs.mkShell {
packages = [
nvim-wrapped
];
shellHook = ''
export TREE_SITTER_LIB_PATH="${pkgs.tree-sitter}/lib"
echo "Neovim LSP environment loaded"
export DEVSHELL_NAME="󱄅 flake/#89dceb"
'';
};
};
}