Skip to content

Instantly share code, notes, and snippets.

@smolck
Created March 18, 2020 01:50
Show Gist options
  • Save smolck/203b740e6331f7e8c4a2862b0d565f21 to your computer and use it in GitHub Desktop.
Save smolck/203b740e6331f7e8c4a2862b0d565f21 to your computer and use it in GitHub Desktop.

Revisions

  1. smolck created this gist Mar 18, 2020.
    47 changes: 47 additions & 0 deletions neovim.nix
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    self: prev:

    let
    neovim-unwrapped-master =
    (prev.neovim-unwrapped.override {
    lua = self.luajit;
    }).overrideAttrs(oldAttrs: {
    cmakeBuildType="debug";
    cmakeFlags = oldAttrs.cmakeFlags ++ [ "-DMIN_LOG_LEVEL=0" ];

    version = "master";
    src = builtins.fetchGit {
    url = https://github.com/neovim/neovim.git;
    };

    nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [
    # self.pkgs.valgrind

    # testing between both
    self.pkgs.ccls
    self.pkgs.clang-tools # for clangd
    ];

    buildInputs = oldAttrs.buildInputs ++ [
    self.pkgs.icu # for treesitter unicode/ptypes.h
    self.pkgs.utf8proc
    ];

    # export NVIM_PROG
    # https://github.com/neovim/neovim/blob/master/test/README.md#configuration
    shellHook = oldAttrs.shellHook + ''
    export NVIM_PYTHON_LOG_LEVEL=DEBUG
    export NVIM_LOG_FILE=/tmp/log
    # export NVIM_PYTHON_LOG_FILE=/tmp/log
    export VALGRIND_LOG="$PWD/valgrind.log"
    export NVIM_TEST_PRINT_I=1
    export NVIM_TEST_MAIN_CDEFS=1
    echo "To run tests:"
    echo "VALGRIND=1 TEST_FILE=test/functional/core/job_spec.lua TEST_TAG=env make functionaltest"
    '';
    });
    in
    {
    neovim-unwrapped = prev.wrapNeovim neovim-unwrapped-master {
    withNodeJs = true;
    };
    }