2023-06-13 06:58:03 +00:00
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore incremental dependencies based on the project TODO: just install these things, then symlink to mason's bin directory
2022-12-30 08:45:15 +00:00
#
# One thing to consider, though, /nix/store of `nix-shell` or `nix-develop`
2023-06-12 06:51:47 +00:00
# might be different from `home-manager`'s (~/.nix_profile/bin/jq)
2022-12-30 08:45:15 +00:00
{ pkgs , lib , config , proj_root , . . . }:
2022-12-28 02:53:38 +00:00
let
# NOTE: Add packages to nvim_pkgs instead, so that it's available at userspace
# and is added to the path after wrapping.
# check: nix repl `homeConfigurations.hungtr.config.programs.neovim.finalPackage.buildCommand`
# see: :/--suffix.*PATH
# there should be mentions of additional packages
my_neovim = pkgs . neovim-unwrapped ;
rust_pkgs = ( pkgs . rust-bin . selectLatestNightlyWith
(
toolchain :
toolchain . default . override {
2023-05-16 16:26:57 +00:00
extensions = [ " r u s t - s r c " " r u s t - a n a l y z e r " " r u s t - d o c s " " r u s t f m t " " c l i p p y " " m i r i " ] ;
2022-12-28 02:53:38 +00:00
}
) ) ;
nvim_pkgs = [
# pkgs.gccStdenv
pkgs . tree-sitter
pkgs . fzf # file name fuzzy search
pkgs . ripgrep # content fuzzy search
pkgs . zk # Zettelkasten (limited support)
pkgs . fd # Required by a Telescope plugin (?)
pkgs . stdenv . cc . cc . lib
2023-05-16 16:26:57 +00:00
pkgs . rnix-lsp # doesn't work, Mason just installs it using cargo
2023-01-19 21:37:58 +00:00
pkgs . rust4cargo
2023-02-14 17:06:39 +00:00
pkgs . nickel
2023-06-16 23:12:54 +00:00
pkgs . nls
2023-01-19 21:37:58 +00:00
2023-02-28 19:04:25 +00:00
pkgs . go # doesn't work, Mason installs from runtime path
2023-01-25 18:44:16 +00:00
2022-12-28 02:53:38 +00:00
# Language-specific stuffs
pkgs . sumneko-lua-language-server
2023-01-19 21:30:25 +00:00
# pkgs.python3Packages.python-lsp-server
pkgs . nodePackages . pyright
pkgs . python3Packages . pylint
pkgs . python3Packages . flake8
2023-05-02 16:28:34 +00:00
# FIXME: installing ansible from here just doesn't work :/
2023-01-20 18:44:01 +00:00
# pkgs.ansible-lint
2023-01-25 18:44:16 +00:00
# pkgs.python38Packages.ansible
# pkgs.ansible-language-server
2023-01-03 22:34:51 +00:00
# TODO: the devShell should provide rust-analyzer so that
# cargo test builds binaries compatible with rust-analyzer
# pkgs.rust-analyzer
# rust_pkgs
# pkgs.evcxr # Rust REPL for Conjure!
2023-05-16 16:26:57 +00:00
] ++ lib . optionals ( pkgs . stdenv . isDarwin ) (
let
inherit ( pkgs . darwin . apple_sdk . frameworks ) System CoreFoundation ; in
[
System
CoreFoundation
]
) ;
2022-12-28 02:53:38 +00:00
in
{
options . base . neovim = {
enable = lib . mkOption {
default = true ;
description = " e n a b l e p e r s o n a l i z e d n e o v i m a s d e f a u l t e d i t o r " ;
type = lib . types . bool ;
example = false ;
} ;
} ;
config = lib . mkIf config . base . neovim . enable {
2023-03-12 05:27:34 +00:00
# home-manager
2022-12-28 02:53:38 +00:00
programs . neovim = {
enable = true ;
package = my_neovim ;
viAlias = true ;
vimAlias = true ;
withPython3 = true ;
withNodeJs = true ;
extraPackages = nvim_pkgs ;
2023-03-12 05:27:34 +00:00
extraLuaConfig = ( builtins . readFile " ${ proj_root . config . path } / / n e o v i m / i n i t . l u a " ) ;
2023-06-05 03:17:13 +00:00
plugins = ( let inherit ( pkgs . vimPlugins )
plenary-nvim
nvim-treesitter
nvim-treesitter-textobjects
nvim-treesitter-context
telescope-fzf-native-nvim
telescope-file-browser-nvim
telescope-nvim
nvim-lspconfig
gruvbox-community
neodev-nvim
cmp-nvim-lsp
cmp-path
cmp-buffer
cmp-cmdline
nvim-cmp
lspkind-nvim
nvim-autopairs
nvim-ts-autotag
guess-indent-nvim
harpoon
zk-nvim
luasnip
2023-06-07 04:19:13 +00:00
fidget-nvim
2023-06-12 06:51:47 +00:00
rust-tools-nvim
cmp_luasnip
gitsigns-nvim
indent-blankline-nvim
lualine-nvim
mason-lspconfig-nvim
mason-nvim
neogit
nlua-nvim
nvim-jqx
nvim-surround
nvim-web-devicons
playground
todo-comments-nvim
trouble-nvim
vim-dispatch
vim-dispatch-neovim
vim-fugitive
vim-jack-in
2023-06-05 03:17:13 +00:00
; in [
plenary-nvim
nvim-treesitter . withAllGrammars
nvim-treesitter-textobjects
telescope-fzf-native-nvim
telescope-file-browser-nvim
telescope-nvim
nvim-lspconfig
gruvbox-community
neodev-nvim
cmp-nvim-lsp
cmp-path
cmp-buffer
cmp-cmdline
nvim-cmp
lspkind-nvim
nvim-autopairs
nvim-ts-autotag
guess-indent-nvim
harpoon
zk-nvim
luasnip
nvim-treesitter-context
2023-06-07 04:19:13 +00:00
fidget-nvim
2023-06-12 06:51:47 +00:00
rust-tools-nvim
cmp_luasnip
gitsigns-nvim
indent-blankline-nvim
lualine-nvim
mason-lspconfig-nvim
mason-nvim
neogit
nlua-nvim
nvim-jqx
nvim-surround
nvim-web-devicons
playground
todo-comments-nvim
trouble-nvim
vim-dispatch
vim-dispatch-neovim
vim-fugitive
vim-jack-in
2023-06-05 03:17:13 +00:00
] ) ;
2022-12-28 02:53:38 +00:00
} ;
2022-12-30 08:45:15 +00:00
# home.packages = nvim_pkgs;
2022-12-28 02:53:38 +00:00
} ;
}