forked from rest-nvim/rest.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
84 lines (76 loc) · 2.44 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
{
description = "rest.nvim: A fast Neovim http client written in Lua";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
mkDevShell = luaVersion:
let
luaEnv = pkgs."lua${luaVersion}".withPackages (lp: with lp; [
busted
luacheck
luarocks
]);
in
pkgs.mkShell {
name = "rest-nvim";
buildInputs = [
pkgs.sumneko-lua-language-server
luaEnv
pkgs.stylua
];
shellHook = let
myVimPackage = with pkgs.vimPlugins; {
start = [ plenary-nvim (nvim-treesitter.withPlugins (
plugins: with plugins; [
tree-sitter-lua
tree-sitter-http
tree-sitter-json
]
))];
};
packDirArgs.myNeovimPackages = myVimPackage;
in
''
export DEBUG_PLENARY="debug"
cat <<-EOF > minimal.vim
set rtp+=.
set packpath^=${pkgs.vimUtils.packDir packDirArgs}
EOF
'';
};
in
{
devShells = {
default = self.devShells.${system}.luajit;
ci = let
neovimConfig = pkgs.neovimUtils.makeNeovimConfig {
plugins = with pkgs.vimPlugins; [
{ plugin = (nvim-treesitter.withPlugins (
plugins: with plugins; [
tree-sitter-lua
tree-sitter-http
tree-sitter-json
]
));
}
{ plugin = plenary-nvim; }
];
customRC = "";
wrapRc = false;
};
myNeovim = pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped neovimConfig;
in
(mkDevShell "jit").overrideAttrs(oa: {
buildInputs = oa.buildInputs ++ [ myNeovim ];
});
luajit = mkDevShell "jit";
lua-51 = mkDevShell "5_1";
lua-52 = mkDevShell "5_2";
};
});
}