|
6 | 6 |
|
7 | 7 | flake-parts.url = "github:hercules-ci/flake-parts";
|
8 | 8 |
|
9 |
| - pre-commit-hooks = { |
10 |
| - url = "github:cachix/pre-commit-hooks.nix"; |
11 |
| - }; |
| 9 | + pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; |
12 | 10 |
|
13 |
| - neorocks = { |
14 |
| - url = "github:nvim-neorocks/neorocks"; |
15 |
| - }; |
| 11 | + neorocks.url = "github:nvim-neorocks/neorocks"; |
16 | 12 |
|
17 |
| - neodev-nvim = { |
18 |
| - url = "github:folke/neodev.nvim"; |
19 |
| - flake = false; |
20 |
| - }; |
| 13 | + gen-luarc.url = "github:mrcjkb/nix-gen-luarc-json"; |
21 | 14 | };
|
22 | 15 |
|
23 | 16 | outputs = inputs @ {
|
|
26 | 19 | flake-parts,
|
27 | 20 | pre-commit-hooks,
|
28 | 21 | neorocks,
|
29 |
| - neodev-nvim, |
| 22 | + gen-luarc, |
30 | 23 | ...
|
31 | 24 | }: let
|
32 | 25 | name = "rustaceanvim";
|
|
51 | 44 | ci-overlay = import ./nix/ci-overlay.nix {
|
52 | 45 | inherit
|
53 | 46 | self
|
54 |
| - neodev-nvim |
55 | 47 | ;
|
56 | 48 | plugin-name = name;
|
57 | 49 | };
|
|
61 | 53 | overlays = [
|
62 | 54 | ci-overlay
|
63 | 55 | neorocks.overlays.default
|
| 56 | + gen-luarc.overlays.default |
64 | 57 | plugin-overlay
|
65 | 58 | ];
|
66 | 59 | };
|
67 | 60 |
|
68 |
| - mkTypeCheck = { |
69 |
| - rtp ? [], |
70 |
| - disabled-diagnostics ? [], |
71 |
| - }: |
72 |
| - pre-commit-hooks.lib.${system}.run { |
73 |
| - src = self; |
74 |
| - hooks = { |
75 |
| - lua-ls.enable = true; |
76 |
| - }; |
77 |
| - settings = { |
78 |
| - lua-ls = { |
79 |
| - config = { |
80 |
| - runtime.version = "LuaJIT"; |
81 |
| - Lua = { |
82 |
| - workspace = { |
83 |
| - library = |
84 |
| - rtp |
85 |
| - ++ (with pkgs.vimPlugins; [ |
86 |
| - "${nvim-dap}/lua" |
87 |
| - "${toggleterm-nvim}/lua" |
88 |
| - "${neotest}/lua" |
89 |
| - "\${3rd}/busted/library" |
90 |
| - "\${3rd}/luassert/library" |
91 |
| - ]); |
92 |
| - checkThirdParty = false; |
93 |
| - ignoreDir = [ |
94 |
| - ".git" |
95 |
| - ".github" |
96 |
| - ".direnv" |
97 |
| - "result" |
98 |
| - "nix" |
99 |
| - "doc" |
100 |
| - "spec" # FIXME: busted library |
101 |
| - ]; |
102 |
| - }; |
103 |
| - diagnostics = { |
104 |
| - libraryFiles = "Disable"; |
105 |
| - disable = disabled-diagnostics; |
106 |
| - }; |
107 |
| - }; |
108 |
| - }; |
109 |
| - }; |
110 |
| - }; |
111 |
| - }; |
| 61 | + luarc-plugins = with pkgs.lua51Packages; |
| 62 | + [ |
| 63 | + nvim-nio |
| 64 | + ] |
| 65 | + ++ (with pkgs.vimPlugins; [ |
| 66 | + neotest |
| 67 | + nvim-dap |
| 68 | + ]); |
| 69 | + |
| 70 | + luarc-nightly = pkgs.mk-luarc { |
| 71 | + nvim = pkgs.neovim-nightly; |
| 72 | + neodev-types = "nightly"; |
| 73 | + plugins = luarc-plugins; |
| 74 | + }; |
112 | 75 |
|
113 |
| - type-check-stable = mkTypeCheck { |
114 |
| - rtp = [ |
115 |
| - "${pkgs.neovim}/share/nvim/runtime/lua" |
116 |
| - "${pkgs.neodev-plugin}/types/stable" |
117 |
| - ]; |
| 76 | + luarc-stable = pkgs.mk-luarc { |
| 77 | + nvim = pkgs.neovim-unwrapped; |
| 78 | + neodev-types = "stable"; |
| 79 | + plugins = luarc-plugins; |
118 | 80 | disabled-diagnostics = [
|
119 | 81 | "undefined-doc-name"
|
120 | 82 | "redundant-parameter"
|
121 | 83 | "invisible"
|
122 | 84 | ];
|
123 | 85 | };
|
124 | 86 |
|
125 |
| - type-check-nightly = mkTypeCheck { |
126 |
| - rtp = [ |
127 |
| - "${pkgs.neovim-nightly}/share/nvim/runtime/lua" |
128 |
| - "${pkgs.neodev-plugin}/types/nightly" |
129 |
| - ]; |
| 87 | + type-check-nightly = pre-commit-hooks.lib.${system}.run { |
| 88 | + src = self; |
| 89 | + hooks = { |
| 90 | + lua-ls.enable = true; |
| 91 | + }; |
| 92 | + settings = { |
| 93 | + lua-ls.config = luarc-nightly; |
| 94 | + }; |
| 95 | + }; |
| 96 | + |
| 97 | + type-check-stable = pre-commit-hooks.lib.${system}.run { |
| 98 | + src = self; |
| 99 | + hooks = { |
| 100 | + lua-ls.enable = true; |
| 101 | + }; |
| 102 | + settings = { |
| 103 | + lua-ls.config = luarc-stable; |
| 104 | + }; |
130 | 105 | };
|
131 | 106 |
|
132 | 107 | pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
|
142 | 117 |
|
143 | 118 | devShell = pkgs.nvim-nightly-tests.overrideAttrs (oa: {
|
144 | 119 | name = "rustaceanvim devShell";
|
145 |
| - inherit (pre-commit-check) shellHook; |
| 120 | + shellHook = '' |
| 121 | + ${pre-commit-check.shellHook} |
| 122 | + ln -fs ${pkgs.luarc-to-json luarc-nightly} .luarc.json |
| 123 | + ''; |
146 | 124 | buildInputs = with pre-commit-hooks.packages.${system};
|
147 | 125 | [
|
148 | 126 | alejandra
|
|
0 commit comments