/
default.nix
166 lines (145 loc) · 3.88 KB
/
default.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
{ self, config, pkgs, lib, ... }:
let
vars = import ../vars.nix;
# TODO put in a better place
utils = import ../../../utils { pkgs = pkgs; };
# Helper function to add plugins directly from GitHub if they are not
# packaged in nixpkgs yet
plugin = name: repo: branch: sha256:
pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "vim-plugin-${name}";
version = "git";
src = builtins.fetchGit {
url = "https://github.com/${repo}.git";
ref = branch;
rev = sha256;
};
};
in {
home.packages = with pkgs; [
nodePackages.pyright # LSP python
nodePackages.yaml-language-server # LSP yaml
nodePackages.vscode-json-languageserver-bin # LSP json
vscode-extensions.golang.Go # Golang snippets
gopls # LSP go
terraform-ls # LSP terraform
terraform # TODO add options to enable/disable large packages like terraform
libgccjit # Needed for treesitter
sumneko-lua-language-server # Lua language server
cargo
rustc
rustfmt
rust-analyzer
];
xdg = {
enable = true;
configFile = {
nixcolors-lua = {
target = "nvim/lua/nixcolors.lua";
source =
utils.renderMustache "nixcolors.lua" ./nixcolors.lua.mustache vars.colors;
};
nvim_lua_config = {
target = "nvim/lua/config";
source = ./lua/config;
};
nvim_lua_utils = {
target = "nvim/lua/utils";
source = ./lua/utils;
};
colors = {
target = "nvim/colors/generated.vim";
text = ''" File empty on purpouse'';
};
nvim_vimscript = {
target = "nvim/vimscript";
source = ./vimscript;
};
};
};
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withPython3 = true;
withRuby = true;
extraConfig = ''
lua << EOF
local utils = require('utils')
require('config.general') -- General options, should stay first!
require('config.pinpox-colors')
require('config.appearance')
-- require('config.treesitter')
require('config.lsp')
require('config.devicons')
require('config.compe')
require('config.which-key')
require('config.bufferline')
require('config.lualine')
require('config.gitsigns')
require('config.zk')
EOF
" Add snippet directories from packages
let g:vsnip_snippet_dirs = ['${pkgs.vscode-extensions.golang.Go}/share/vscode/extensions/golang.Go/snippets/']
'';
# loaded on launch
plugins = with pkgs.vimPlugins; [
# nvim-treesitter
zk-nvim
nvim-fzf
indent-blankline-nvim-lua
colorbuddy-nvim
BufOnly-vim
friendly-snippets
ansible-vim
lspsaga-nvim
base16-vim
committia-vim
fzf-vim
gitsigns-nvim
gotests-vim
haskell-vim
i3config-vim
lualine-nvim
nvim-bufferline-lua
nvim-compe
nvim-colorizer-lua
nvim-lspconfig
nvim-web-devicons
plenary-nvim
tabular
vim-autoformat
vim-better-whitespace
vim-commentary
vim-devicons
vim-easy-align
vim-eunuch
vim-go
vim-gutentags
vim-illuminate
# vim-indent-object
# vim-markdown # Disabled because of https://github.com/plasticboy/vim-markdown/issues/461
which-key-nvim
vim-nix
vim-repeat
vim-sandwich
vim-table-mode
vim-terraform
vim-textobj-user
vim-vinegar
vim-visual-increment
vim-vsnip
vim-gnupg
vim-vsnip-integ
];
};
}
# TODO Missing plugins
# TODO use flake inputs for this, if needed
# autopairs
# fvictorio/vim-textobj-backticks'
# nicwest/vim-camelsnek'
# thinca/vim-textobj-between' "Text objects for a range between a character
# timakro/vim-searchant' " Better highlighting of search