-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathneovim-overlay.nix
More file actions
130 lines (122 loc) · 5.36 KB
/
neovim-overlay.nix
File metadata and controls
130 lines (122 loc) · 5.36 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# 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;
};
# Make sure we use the pinned nixpkgs instance for wrapNeovimUnstable,
# otherwise it could have an incompatible signature when applying this overlay.
pkgs-locked = inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system};
# This is the helper function that builds the Neovim derivation.
mkNeovim = pkgs.callPackage ./mkNeovim.nix {
inherit (pkgs-locked) wrapNeovimUnstable neovimUtils;
};
# 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.
# https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=vimPlugins
nvim-treesitter.withAllGrammars
luasnip # snippets | https://github.com/l3mon4d3/luasnip/
# nvim-cmp (autocompletion) and extensions
nvim-cmp # https://github.com/hrsh7th/nvim-cmp
cmp_luasnip # snippets autocompletion extension for nvim-cmp | https://github.com/saadparwaiz1/cmp_luasnip/
lspkind-nvim # vscode-like LSP pictograms | https://github.com/onsails/lspkind.nvim/
cmp-nvim-lsp # LSP as completion source | https://github.com/hrsh7th/cmp-nvim-lsp/
cmp-nvim-lsp-signature-help # https://github.com/hrsh7th/cmp-nvim-lsp-signature-help/
cmp-buffer # current buffer as completion source | https://github.com/hrsh7th/cmp-buffer/
cmp-path # file paths as completion source | https://github.com/hrsh7th/cmp-path/
cmp-nvim-lua # neovim lua API as completion source | https://github.com/hrsh7th/cmp-nvim-lua/
cmp-cmdline # cmp command line suggestions
cmp-cmdline-history # cmp command line history suggestions
# ^ nvim-cmp extensions
# git integration plugins
diffview-nvim # https://github.com/sindrets/diffview.nvim/
neogit # https://github.com/TimUntersberger/neogit/
gitsigns-nvim # https://github.com/lewis6991/gitsigns.nvim/
vim-fugitive # https://github.com/tpope/vim-fugitive/
# ^ git integration plugins
# telescope and extensions
telescope-nvim # https://github.com/nvim-telescope/telescope.nvim/
telescope-fzy-native-nvim # https://github.com/nvim-telescope/telescope-fzy-native.nvim
# telescope-smart-history-nvim # https://github.com/nvim-telescope/telescope-smart-history.nvim
# ^ telescope and extensions
# UI
lualine-nvim # Status line | https://github.com/nvim-lualine/lualine.nvim/
nvim-navic # Add LSP location to lualine | https://github.com/SmiteshP/nvim-navic
statuscol-nvim # Status column | https://github.com/luukvbaal/statuscol.nvim/
nvim-treesitter-context # nvim-treesitter-context
# ^ UI
# language support
# ^ language support
# navigation/editing enhancement plugins
vim-unimpaired # predefined ] and [ navigation keymaps | https://github.com/tpope/vim-unimpaired/
eyeliner-nvim # Highlights unique characters for f/F and t/T motions | https://github.com/jinh0/eyeliner.nvim
nvim-surround # https://github.com/kylechui/nvim-surround/
nvim-treesitter-textobjects # https://github.com/nvim-treesitter/nvim-treesitter-textobjects/
nvim-ts-context-commentstring # https://github.com/joosepalviste/nvim-ts-context-commentstring/
# ^ navigation/editing enhancement plugins
# Useful utilities
nvim-unception # Prevent nested neovim sessions | nvim-unception
# ^ Useful utilities
# libraries that other plugins depend on
sqlite-lua
plenary-nvim
nvim-web-devicons
vim-repeat
# ^ libraries that other plugins depend on
# bleeding-edge plugins from flake inputs
# (mkNvimPlugin inputs.wf-nvim "wf.nvim") # (example) keymap hints | https://github.com/Cassin01/wf.nvim
# ^ bleeding-edge plugins from flake inputs
which-key-nvim
];
extraPackages = with pkgs; [
# language servers, etc.
lua-language-server
nil # nix LSP
];
in {
# This is the neovim derivation
# returned by the overlay
nvim-pkg = mkNeovim {
plugins = all-plugins;
inherit extraPackages;
};
# This is meant to be used within a devshell.
# Instead of loading the lua Neovim configuration from
# the Nix store, it is loaded from $XDG_CONFIG_HOME/nvim-dev
nvim-dev = mkNeovim {
plugins = all-plugins;
inherit extraPackages;
appName = "nvim-dev";
wrapRc = false;
};
# 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;
# };
}