generated from nix-community/kickstart-nix.nvim
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneovim-overlay.nix
80 lines (74 loc) · 2.06 KB
/
neovim-overlay.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# This overlay, when applied to nixpkgs, adds the final neovim derivation to nixpkgs.
{inputs}: final: prev:
with final.pkgs.lib; let
pkgs = final;
# Use this to create a plugin from a flake input
mkNvimPlugin = src: pname:
pkgs.vimUtils.buildVimPlugin {
inherit pname src;
version = src.lastModifiedDate;
};
# This is the helper function that builds the Neovim derivation.
mkNeovim = pkgs.callPackage ./mkNeovim.nix {};
# A plugin can either be a package or an attrset, such as
# { plugin = <plugin>; # the package, e.g. pkgs.vimPlugins.nvim-cmp
# config = <config>; # String; a config that will be loaded with the plugin
# # Boolean; Whether to automatically load the plugin as a 'start' plugin,
# # or as an 'opt' plugin, that can be loaded with `:packadd!`
# optional = <true|false>; # Default: false
# ...
# }
all-plugins = with pkgs.vimPlugins; [
# plugins from nixpkgs go in here.
cmp-nvim-lsp
ctrlp-vim
vim-fugitive
gruvbox-nvim
intero-neovim
markdown-preview-nvim
neoconf-nvim
neodev-nvim
nvim-cmp
nvim-lspconfig
nvim-navic
nvim-tree-lua
nvim-treesitter.withAllGrammars
nvim-treesitter-context
nvim-treesitter-textobjects
nvim-ts-context-commentstring
nvim-web-devicons
vim-tmux
which-key-nvim
];
extraPackages = with pkgs; [
# language servers, etc.
lua-language-server
tree-sitter
nil # nix LSP
];
in {
# This is the neovim derivation
# returned by the overlay
nvim-pkg = mkNeovim {
plugins = all-plugins;
inherit extraPackages;
};
# This can be symlinked in the devShell's shellHook
nvim-luarc-json = final.mk-luarc-json {
plugins = all-plugins;
};
# You can add as many derivations as you like.
# Use `ignoreConfigRegexes` to filter out config
# files you would not like to include.
#
# For example:
#
# nvim-pkg-no-telescope = mkNeovim {
# plugins = [];
# ignoreConfigRegexes = [
# "^plugin/telescope.lua"
# "^ftplugin/.*.lua"
# ];
# inherit extraPackages;
# };
}