Get a newer msgpack to Neovim

I’ve been hacking away at this problem for a couple of days now and I think I’ve exhausted all my Nix trickery.

I’m using Neovim and trying to get the deoplete plugin working. Importantly, deoplete requires msgpack >=1.0.0 (here’s where it checks).

<nixpkgs>.neovim is defined here:

It looks like when deoplete invokes python3 it’s getting python3Packages.pynvim (see this line). I can neovim.override to override the wrapper arguments but I can’t figure out how to get at the callPackage arguments (where I could fiddle with python3Packages).

Ideally I’d do this in a way that is local to the neovim derivation (i.e. without overlays). Specifically I’d like a single file that looks like:

# neovim-with-new-msgpack.nix
{ pkgs }: /* your solution here */


1 Like

So I had a look at how Neovim is done in pkgs/top-level/all-packages.nix and it seems to put the wrapper.nix you linked into wrapNeovim and then calls wrapNeovim with neovim-unwrapped (from default.nix in the same folder as wrapper.nix). Something like this might work but I haven’t tested it at all and it is nearly 2am:

# my-sick-new-neovim-final(2)(1).nix
{ pkgs }:

  msgpack = ...;
  myPython = pkgs.python3Packages.python.override {
    packageOverrides = acc: old: { inherit msgpack; };
  myCustomPy3Pkgs = pkgs.python3Packages // { python = myPython; };

in pkgs.wrapNeovim.override { python3Packages = myCustomPy3Pkgs; } pkgs.neovim-unwrapped {}

Yep that worked, cheers :pray:

For reference:

{ python3Packages, wrapNeovim, neovim-unwrapped }:

  python_msgpack_1 = python3Packages.python.override {
    packageOverrides = python-self: python-super: {
      # For the deoplete plugin
      msgpack = python-super.msgpack.overrideAttrs (oldAttrs: rec {
        pname = "msgpack";
        version = "1.0.0";
        src = python-super.fetchPypi {
          inherit pname version;
          sha256 = "1h5mxh84rcw04dvxy1qbfn2hisavfqgilh9k09rgyjhd936dad4m";

in wrapNeovim.override {
  python3Packages = python3Packages // { python = python_msgpack_1; };
} neovim-unwrapped { vimAlias = true; }

1 Like