|
14 | 14 | flake = false; |
15 | 15 | }; |
16 | 16 | flake-utils.url = "github:numtide/flake-utils"; |
17 | | - pre-commit-hooks = { |
18 | | - url = "github:cachix/pre-commit-hooks.nix"; |
19 | | - }; |
20 | 17 | gitignore = { |
21 | 18 | url = "github:hercules-ci/gitignore.nix"; |
22 | 19 | flake = false; |
|
92 | 89 | flake = false; |
93 | 90 | }; |
94 | 91 | myst-parser = { |
95 | | - url = "github:smunix/MyST-Parser?ref=fix.hls-docutils"; |
| 92 | + url = "github:smunix/MyST-Parser?ref=fix.hls-docutils"; |
96 | 93 | flake = false; |
97 | 94 | }; |
98 | 95 | # For https://github.com/readthedocs/sphinx_rtd_theme/pull/1185, otherwise lists are broken locally |
|
103 | 100 | poetry2nix.url = "github:nix-community/poetry2nix/master"; |
104 | 101 | }; |
105 | 102 | outputs = |
106 | | - inputs@{ self, nixpkgs, flake-compat, flake-utils, pre-commit-hooks, gitignore, ... }: |
| 103 | + inputs@{ self, nixpkgs, flake-compat, flake-utils, gitignore, ... }: |
107 | 104 | { |
108 | 105 | overlays.default = final: prev: |
109 | 106 | with prev; |
|
123 | 120 | in hsuper.mkDerivation (args // { |
124 | 121 | jailbreak = if broken then true else jailbreak; |
125 | 122 | doCheck = if broken then false else check; |
126 | | - # Library profiling is disabled as it causes long compilation time |
| 123 | + # Library profiling is disabled as it causes long compilation time |
127 | 124 | # on our CI jobs. Nix users are free tor revert this anytime. |
128 | 125 | enableLibraryProfiling = false; |
129 | 126 | doHaddock = false; |
|
215 | 212 | config = { allowBroken = true; }; |
216 | 213 | }; |
217 | 214 |
|
218 | | - # Pre-commit hooks to run stylish-haskell |
219 | | - pre-commit-check = hpkgs: pre-commit-hooks.lib.${system}.run { |
220 | | - src = ./.; |
221 | | - hooks = { |
222 | | - stylish-haskell.enable = true; |
223 | | - # use stylish-haskell with our target ghc |
224 | | - stylish-haskell.entry = pkgs.lib.mkForce "${hpkgs.stylish-haskell}/bin/stylish-haskell --inplace"; |
225 | | - stylish-haskell.excludes = [ |
226 | | - # Ignored files |
227 | | - "^Setup.hs$" |
228 | | - "test/testdata/.*$" |
229 | | - "test/data/.*$" |
230 | | - "test/manual/lhs/.*$" |
231 | | - "^hie-compat/.*$" |
232 | | - "^plugins/hls-tactics-plugin/.*$" |
233 | | - |
234 | | - # Temporarily ignored files |
235 | | - # Stylish-haskell (and other formatters) does not work well with some CPP usages in these files |
236 | | - "^ghcide/src/Development/IDE/GHC/Compat.hs$" |
237 | | - "^ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs$" |
238 | | - "^ghcide/src/Development/IDE/GHC/Compat/Core.hs$" |
239 | | - "^ghcide/src/Development/IDE/Spans/Pragmas.hs$" |
240 | | - "^ghcide/src/Development/IDE/LSP/Outline.hs$" |
241 | | - "^plugins/hls-splice-plugin/src/Ide/Plugin/Splice.hs$" |
242 | | - "^ghcide/test/exe/Main.hs$" |
243 | | - "ghcide/src/Development/IDE/Core/Rules.hs" |
244 | | - "^hls-test-utils/src/Test/Hls/Util.hs$" |
245 | | - ]; |
246 | | - }; |
247 | | - }; |
248 | | - |
249 | 215 | ghc902Config = (import ./configuration-ghc-90.nix) { inherit pkgs inputs; }; |
250 | 216 | ghc922Config = (import ./configuration-ghc-92.nix) { inherit pkgs inputs; }; |
251 | 217 |
|
252 | 218 | # GHC versions |
253 | | - # While HLS still works fine with 8.10 GHCs, we only support the versions that are cached |
| 219 | + # While HLS still works fine with 8.10 GHCs, we only support the versions that are cached |
254 | 220 | # by upstream nixpkgs, which now only includes GHC version 9+ |
255 | 221 | supportedGHCs = let |
256 | 222 | ghcVersion = "ghc" + (pkgs.lib.replaceStrings ["."] [""] pkgs.haskellPackages.ghc.version); |
|
268 | 234 | myst-parser = pkgs.poetry2nix.mkPoetryEnv { |
269 | 235 | projectDir = inputs.myst-parser; |
270 | 236 | python = pkgs.python39; |
271 | | - overrides = [ |
| 237 | + overrides = [ |
272 | 238 | pkgs.poetry2nix.defaultPoetryOverrides |
273 | 239 | ]; |
274 | 240 | }; |
275 | 241 | sphinx_rtd_theme = pkgs.poetry2nix.mkPoetryEnv { |
276 | 242 | projectDir = inputs.sphinx_rtd_theme; |
277 | 243 | python = pkgs.python39; |
278 | | - overrides = [ |
| 244 | + overrides = [ |
279 | 245 | pkgs.poetry2nix.defaultPoetryOverrides |
280 | 246 | (self: super: { |
281 | 247 | # The RTD theme doesn't work with newer docutils |
|
334 | 300 | export DYLD_LIBRARY_PATH=${gmp}/lib:${zlib}/lib:${ncurses}/lib:${capstone}/lib |
335 | 301 | export PATH=$PATH:$HOME/.local/bin |
336 | 302 |
|
337 | | - # Enable the shell hooks |
338 | | - ${self.checks.${system}.pre-commit-check.shellHook} |
| 303 | + # Install pre-commit hook |
| 304 | + pre-commit install |
339 | 305 |
|
340 | 306 | # If the cabal project file is not the default one. |
341 | 307 | # Print a warning and generate an alias. |
|
0 commit comments