-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneovim.nix
57 lines (53 loc) · 1.58 KB
/
neovim.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
{ lib, pkgs, neovim-nightly-src, ... }:
let
binpath = lib.makeBinPath (with pkgs; [
lua-language-server
stylua
lua # required for luarocks.nvim to work
nil # nix-ls
nixfmt
nodePackages.prettier
nodePackages.pyright
# I can't install this with the rest of the python packages b/c this needs to be in path
python3Packages.jupytext
]);
neovimConfig = pkgs.neovimUtils.makeNeovimConfig {
extraLuaPackages = p: [ p.magick ];
extraPython3Packages = p:
with p; [
pynvim
jupyter-client
cairosvg
ipython
nbformat
];
extraPackages = p: with p; [ imageMagick ];
withNodeJs = true;
withRuby = true;
withPython3 = true;
# https://github.com/NixOS/nixpkgs/issues/211998
customRC = "luafile ~/.config/nvim/init.lua";
};
fullConfig = (neovimConfig // {
wrapperArgs = lib.escapeShellArgs neovimConfig.wrapperArgs
+ " --prefix PATH : ${binpath}";
});
in {
nixpkgs.overlays = [
(_: super: {
neovim-nightly = pkgs.wrapNeovimUnstable
(super.neovim-unwrapped.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs ++ [ super.tree-sitter ];
src = neovim-nightly-src;
})) fullConfig;
neovim-stable = pkgs.wrapNeovimUnstable
(super.neovim-unwrapped.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs ++ [ super.tree-sitter ];
})) fullConfig;
})
];
environment.systemPackages = with pkgs; [
neovim-nightly
(writeScriptBin "nvim_stable" ''${neovim-stable}/bin/nvim "$@"'')
];
}