blob: c9d30dbba4528764a78ff2d54416d80be5b7e188 (
plain)
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
|
{
config,
lib,
pkgs,
...
}:
let
inherit (lib)
mkOption
types
mkIf
optionals
;
cfg = config.nx.editors.neovim;
in
{
options.nx.editors.neovim = {
enable = mkOption {
description = "Neovim editor";
type = types.bool;
default = true;
};
langs = {
python = mkOption {
description = "enable the python integration";
type = types.bool;
default = false;
};
go = mkOption {
description = "enable go integration";
type = types.bool;
default = false;
};
ts = mkOption {
description = "enable the js/ts integration";
type = types.bool;
default = false;
};
nix = mkOption {
description = "enable the nix integration";
type = types.bool;
default = true;
};
lua = mkOption {
description = "enable the lua integration";
type = types.bool;
default = true;
};
latex = mkOption {
description = "enable latex integration";
type = types.bool;
default = false;
};
typst = mkOption {
description = "enable typst integration";
type = types.bool;
default = false;
};
};
};
config = mkIf cfg.enable {
programs.neovim = {
defaultEditor = true;
enable = true;
package = pkgs.neovim-unwrapped;
extraPackages =
with pkgs;
[
tree-sitter
git
ripgrep
fd
gcc
]
++ (optionals cfg.langs.ts [ pkgs.nodePackages.typescript-language-server ])
++ (optionals cfg.langs.python [ ])
++ (optionals cfg.langs.go [ pkgs.gopls ])
++ (optionals cfg.langs.nix [
pkgs.nil
pkgs.nixfmt
])
++ (optionals cfg.langs.lua [ pkgs.lua-language-server ])
++ (optionals cfg.langs.latex [ pkgs.texlab ])
++ (optionals cfg.langs.typst [ pkgs.tinymist ]);
plugins = with pkgs.vimPlugins; [
gruvbox-nvim
mini-starter
gitsigns-nvim
nvim-autopairs
telescope-nvim
fidget-nvim
plenary-nvim
nvim-treesitter.withAllGrammars
nvim-lspconfig
nvim-cmp
cmp-nvim-lsp
cmp-buffer
cmp-path
cmp-cmdline
luasnip
cmp_luasnip
lspkind-nvim
];
extraConfig = ''
luafile ${./init.lua}
'';
};
};
}
|