neovim/nix/package.nix

57 lines
1.1 KiB
Nix

{ pkgs, lib, ... }:
let
deps = with pkgs; [
lua
# Language Servers
rust-analyzer
nil
pyright
bash-language-server
lua-language-server
zls
typescript
nodePackages_latest.typescript-language-server
kdePackages.qtdeclarative # QML formatter
# Formatter
python311Packages.black # Python formatter
clang-tools
nodePackages_latest.prettier # JSON, JS, TS formatter
yamlfmt # YAML formatter
taplo # TOML formatter
rustfmt # Rust formatter
shfmt # Shell, Bash etc.
nixfmt-rfc-style
stylua # lua formatter
# Misc
ripgrep
rustc
cargo
nodejs_22
clang
tree-sitter
fd
luajitPackages.luarocks
wl-clipboard
];
in
pkgs.writeTextFile {
name = "nvim";
executable = true;
destination = "/bin/nvim";
text = ''
#!${pkgs.bash}
export PATH=${lib.makeBinPath deps}:$PATH
export LUA_PATH=${../.}/lua/?.lua
${pkgs.neovim}/bin/nvim -u ${../.}/init.lua $@
'';
checkPhase = ''
${pkgs.stdenv.shellDryRun} "$target"
'';
meta = pkgs.neovim.meta // {
mainProgram = "nvim";
};
}