Skip to content

Instantly share code, notes, and snippets.

@Jomik
Created March 26, 2019 08:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jomik/041c6c6f2fb5062db0d39768eb64c68f to your computer and use it in GitHub Desktop.
Save Jomik/041c6c6f2fb5062db0d39768eb64c68f to your computer and use it in GitHub Desktop.
{
coc-nvim = let
pname = "coc-nvim";
version = "0.0.61";
src = fetchFromGitHub {
owner = "neoclide";
repo = "coc.nvim";
rev = "v${version}";
sha256 = "1as2hb4kfq1m0nq7vp2ibkfq8n219ykr04qx4qadg97s7iky4yx4";
};
deps = pkgs.yarn2nix.mkYarnModules rec {
name = "${pname}-modules-${version}";
packageJSON = src + "/package.json";
yarnLock = src + "/yarn.lock";
};
in buildVimPluginFrom2Nix {
inherit version pname src;
patches = [ ./cocyarnlock.patch ];
configurePhase = ''
mkdir -p node_modules
ln -s ${deps}/node_modules/* node_modules/
ln -s ${deps}/node_modules/.bin node_modules/
'';
postFixup = ''
substituteInPlace $target/autoload/coc/util.vim \
--replace "'yarnpkg'" "'${pkgs.yarn}/bin/yarnpkg'"
substituteInPlace $target/autoload/health/coc.vim \
--replace "'yarnpkg'" "'${pkgs.yarn}/bin/yarnpkg'"
'';
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment