-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
232 lines (173 loc) · 6.77 KB
/
flake.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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
{
description = "Neovim editor, configured by Marcus";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = inputs: let
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
# For all args available for makeNeovimConfig see
# https://github.com/NixOS/nixpkgs/blob/9b79a05ae1311685f77dafbdfc88e81e390b22f1/pkgs/applications/editors/neovim/utils.nix#L26
neovim = pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped (pkgs.neovimUtils.makeNeovimConfig {
withPython3 = false;
withRuby = false;
plugins = [
# USER INTERFACE
# Custom status line configuration (very important)
pkgs.vimPlugins.lualine-nvim
# Color theme
pkgs.vimPlugins.catppuccin-nvim
# Makes the background of CSS colors the actual color defined
pkgs.vimPlugins.nvim-highlight-colors
# NAVIGATION
# Popup project search box with file preview
pkgs.vimPlugins.telescope-nvim
# Fuzzy search for telescope
pkgs.vimPlugins.telescope-fzf-native-nvim
# Telescope file icons
pkgs.vimPlugins.nvim-web-devicons
# Sidebar that can save your ass when you've overriden undos
pkgs.vimPlugins.undotree
# Pin specific files to specific keys for instanst switching
pkgs.vimPlugins.harpoon
# SYNTAX HIGHLIGHTING
# Treesitter parses files into trees of tokens for cheap syntax
# highlighting and easy code folding.
(pkgs.vimPlugins.nvim-treesitter.withPlugins (treesitter: [
treesitter.nix
treesitter.go
treesitter.rust
treesitter.bash
treesitter.fish
treesitter.html
treesitter.css
treesitter.json
treesitter.yaml
treesitter.toml
treesitter.ron
treesitter.lua
treesitter.c
treesitter.templ
treesitter.javascript
treesitter.hyprlang
]))
# LANGUAGE SERVER PROTOCOL
# LSP Zero knows about every language server in existance, and uses
# sensible defaults, whilst allowing overrides when needed.
pkgs.vimPlugins.lsp-zero-nvim
# Lists project-wide LSP errors for you to fix
pkgs.vimPlugins.trouble-nvim
# COMPLETION
# Code completion popup
pkgs.vimPlugins.nvim-cmp
# Code completion of common code patterns
pkgs.vimPlugins.luasnip
pkgs.vimPlugins.cmp_luasnip
# Language Server Protocol configurations & completion
pkgs.vimPlugins.nvim-lspconfig
pkgs.vimPlugins.cmp-nvim-lsp
# Completion for Neovim Lua API
pkgs.vimPlugins.cmp-nvim-lua
# Completion from word extant in the current buffer (file being edited)
pkgs.vimPlugins.cmp-buffer
# Completion from working directory paths
pkgs.vimPlugins.cmp-path
# Completion inside the Neovim command line too
pkgs.vimPlugins.cmp-cmdline
# Complete Neovim command line from it's own history
pkgs.vimPlugins.cmp-cmdline-history
# Complete from Git refs and such (I think)
pkgs.vimPlugins.cmp-git
# EDITING
# Easily comment out blocks of code
pkgs.vimPlugins.vim-commentary
# Parenthesis, string quotes, HTML tag wrapping, all that stuff
pkgs.vimPlugins.vim-surround
# SOURCE CONTROL
# Git commits (and more) inside of Neovim
pkgs.vimPlugins.vim-fugitive
# Color git additions and deletions for each buffer
pkgs.vimPlugins.gitsigns-nvim
# LANGUAGE SPECIFIC
# Syntax highlighting for Nix (However the Nix LSP may supersede this)
pkgs.vimPlugins.vim-nix
# Golang's Templ templating language
pkgs.vimPlugins.templ-vim
# REAPER's (DAW) JSFX plugin language
(pkgs.vimUtils.buildVimPlugin {
pname = "vim-eel2";
version = "2019-11-16";
src = pkgs.fetchFromGitHub {
owner = "TristanCrawford";
repo = "vim-eel2";
rev = "6865d0f3e92bb5feb0108cc20f89f69659021483";
sha256 = "sha256-lAekmwJxXN+Y6zIxcaJTAftA7919J4Vl1SRjdhx2X8M=";
};
})
# UTILS
# A utils library for other plugins (not sure which)
pkgs.vimPlugins.plenary-nvim
# Measure's Neovim's startup time for debugging any issues there
pkgs.vimPlugins.vim-startuptime
];
});
in {
packages.x86_64-linux.nvim = pkgs.symlinkJoin {
name = "nvim";
meta.description = "Neovim including LSP config and servers";
paths = [
(pkgs.runCommand "neovim-wrapper" {
nativeBuildInputs = [ pkgs.makeWrapper ];
} ''
mkdir --parents $out/share/nvim
ln --symbolic \
${pkgs.writeText "neovim-init.lua" (builtins.readFile ./init.lua)} \
$out/share/nvim/init.lua
makeWrapper ${neovim}/bin/nvim $out/bin/nvim \
--add-flags "-u $out/share/nvim/init.lua" \
--suffix PATH : ${pkgs.lib.makeBinPath [
# Nix LSP server
pkgs.nil
# Golang LSP server
pkgs.gopls
# Tailwind LSP server
pkgs.nodePackages."@tailwindcss/language-server"
# BASH LSP server
pkgs.nodePackages.bash-language-server
# HTML, CSS, JSON & Eslint LSP servers
pkgs.nodePackages.vscode-langservers-extracted
# YAML LSP server
pkgs.nodePackages.yaml-language-server
# Rust LSP server
pkgs.rust-analyzer
# Markdown LSP server
pkgs.marksman
# Typescript/JSDoc LSP server
pkgs.typescript-language-server
# Hyprland conf LSP server
(pkgs.fetchFromGitHub {
owner = "hyprland-community";
repo = "hyprls";
rev = "da23c2948d2696f60816ff47bc562bb434ddb8fb";
sha256 = "sha256-TvrbTlMGn1XtMe5lK7/X69nezmGn51TScd06pdthaF8=";
})
# Required by pkgs.vimPlugins.cmp-git
pkgs.curl
# Required by the file content's search of pkgs.vimPlugins.telescope-nvim
pkgs.ripgrep
# Required by the fuzzy finder search for pkgs.vimPlugins.telescope-nvim
pkgs.fzf
]}
# Alias vim to nvim
ln --symbolic $out/bin/nvim $out/bin/vim
'')
# The original Neovim package
pkgs.neovim
];
};
packages.x86_64-linux.default = inputs.self.packages.x86_64-linux.nvim;
apps.x86_64-linux.neovim = {
type = "app";
program = "${inputs.self.packages.x86_64-linux.nvim}/bin/nvim";
};
};
}