diff options
author | Matthieu Coudron <mcoudron@hotmail.com> | 2022-09-03 00:13:39 +0200 |
---|---|---|
committer | Matthieu Coudron <mcoudron@hotmail.com> | 2022-09-05 11:31:22 +0200 |
commit | 29cd072351cfb600c1e04d1b3eb8d52c983bff16 (patch) | |
tree | 8e381b5359bb9ce6cf952a4a72eba175f7c2bbcd | |
parent | 12fe197cffc687cedc65259d9fd8351a25aa7792 (diff) | |
download | rneovim-29cd072351cfb600c1e04d1b3eb8d52c983bff16.tar.gz rneovim-29cd072351cfb600c1e04d1b3eb8d52c983bff16.tar.bz2 rneovim-29cd072351cfb600c1e04d1b3eb8d52c983bff16.zip |
build(flake): add sumneko lsp in PATH
and reformatted the file
-rw-r--r-- | contrib/flake.nix | 117 |
1 files changed, 62 insertions, 55 deletions
diff --git a/contrib/flake.nix b/contrib/flake.nix index a1072674ba..8d94afa5bb 100644 --- a/contrib/flake.nix +++ b/contrib/flake.nix @@ -23,24 +23,25 @@ }); # a development binary to help debug issues - neovim-debug = let - stdenv = if pkgs.stdenv.isLinux then pkgs.llvmPackages_latest.stdenv else pkgs.stdenv; - in + neovim-debug = + let + stdenv = if pkgs.stdenv.isLinux then pkgs.llvmPackages_latest.stdenv else pkgs.stdenv; + in ((neovim.override { - lua = pkgs.luajit; - inherit stdenv; - }).overrideAttrs (oa: { + lua = pkgs.luajit; + inherit stdenv; + }).overrideAttrs (oa: { - dontStrip = true; - NIX_CFLAGS_COMPILE = " -ggdb -Og"; + dontStrip = true; + NIX_CFLAGS_COMPILE = " -ggdb -Og"; - cmakeBuildType = "Debug"; - cmakeFlags = oa.cmakeFlags ++ [ - "-DMIN_LOG_LEVEL=0" - ]; + cmakeBuildType = "Debug"; + cmakeFlags = oa.cmakeFlags ++ [ + "-DMIN_LOG_LEVEL=0" + ]; - disallowedReferences = []; - })); + disallowedReferences = [ ]; + })); # for neovim developers, beware of the slow binary neovim-developer = @@ -68,9 +69,11 @@ inherit system; }; - pythonEnv = pkgs.python3.withPackages(ps: [ + lua = pkgs.lua5_1; + + pythonEnv = pkgs.python3.withPackages (ps: [ ps.msgpack - ps.flake8 # for 'make pylint' + ps.flake8 # for 'make pylint' ]); in rec { @@ -80,14 +83,16 @@ }; checks = { - pylint = pkgs.runCommandNoCC "pylint" { - nativeBuildInputs = [ pythonEnv ]; - preferLocalBuild = true; + pylint = pkgs.runCommandNoCC "pylint" + { + nativeBuildInputs = [ pythonEnv ]; + preferLocalBuild = true; } "make -C ${./..} pylint > $out"; - shlint = pkgs.runCommandNoCC "shlint" { - nativeBuildInputs = [ pkgs.shellcheck ]; - preferLocalBuild = true; + shlint = pkgs.runCommandNoCC "shlint" + { + nativeBuildInputs = [ pkgs.shellcheck ]; + preferLocalBuild = true; } "make -C ${./..} shlint > $out"; }; @@ -100,38 +105,40 @@ defaultApp = apps.nvim; - devShell = let - in - pkgs.neovim-developer.overrideAttrs(oa: { - - buildInputs = with pkgs; oa.buildInputs ++ [ - cmake - pythonEnv - include-what-you-use # for scripts/check-includes.py - jq # jq for scripts/vim-patch.sh -r - shellcheck # for `make shlint` - doxygen # for script/gen_vimdoc.py - clang-tools # for clangd to find the correct headers - ]; + devShells = { + default = pkgs.neovim-developer.overrideAttrs (oa: { + + buildInputs = with pkgs; oa.buildInputs ++ [ + cmake + lua.pkgs.luacheck + sumneko-lua-language-server + pythonEnv + include-what-you-use # for scripts/check-includes.py + jq # jq for scripts/vim-patch.sh -r + shellcheck # for `make shlint` + doxygen # for script/gen_vimdoc.py + clang-tools # for clangd to find the correct headers + ]; - shellHook = oa.shellHook + '' - export NVIM_PYTHON_LOG_LEVEL=DEBUG - export NVIM_LOG_FILE=/tmp/nvim.log - export ASAN_SYMBOLIZER_PATH=${pkgs.llvm_11}/bin/llvm-symbolizer - - # ASAN_OPTIONS=detect_leaks=1 - export ASAN_OPTIONS="log_path=./test.log:abort_on_error=1" - export UBSAN_OPTIONS=print_stacktrace=1 - mkdir -p build/runtime/parser - # nvim looks into CMAKE_INSTALL_DIR. Hack to avoid errors - # when running the functionaltests - mkdir -p outputs/out/share/nvim/syntax - touch outputs/out/share/nvim/syntax/syntax.vim - - # for treesitter functionaltests - mkdir -p runtime/parser - cp -f ${pkgs.tree-sitter.builtGrammars.tree-sitter-c}/parser runtime/parser/c.so - ''; - }); - }); + shellHook = oa.shellHook + '' + export NVIM_PYTHON_LOG_LEVEL=DEBUG + export NVIM_LOG_FILE=/tmp/nvim.log + export ASAN_SYMBOLIZER_PATH=${pkgs.llvm_11}/bin/llvm-symbolizer + + # ASAN_OPTIONS=detect_leaks=1 + export ASAN_OPTIONS="log_path=./test.log:abort_on_error=1" + export UBSAN_OPTIONS=print_stacktrace=1 + mkdir -p build/runtime/parser + # nvim looks into CMAKE_INSTALL_DIR. Hack to avoid errors + # when running the functionaltests + mkdir -p outputs/out/share/nvim/syntax + touch outputs/out/share/nvim/syntax/syntax.vim + + # for treesitter functionaltests + mkdir -p runtime/parser + cp -f ${pkgs.tree-sitter.builtGrammars.tree-sitter-c}/parser runtime/parser/c.so + ''; + }); + }; + }); } |