vimPlugins.copilot-vim: set default g:copilot_node_command

copilot-vim requires NodeJS to function properly since the plugin
bundles JS files. You can set the path to the NodeJS that should be
used manually, in your configuration.

We can set the default value to a valid NodeJS binary, so in the general
case, users don't need to do anything for this plugin to work.

Users can still set g:copilot_node_command manually, if they want to.
This commit is contained in:
Florian Beeres 2023-03-29 00:17:41 +02:00
parent 20a99ed3b4
commit 9821e338d4

View File

@ -301,6 +301,14 @@ self: super: {
dependencies = with self; [ completion-nvim nvim-treesitter ];
});
copilot-vim = super.copilot-vim.overrideAttrs (old: {
postInstall = ''
substituteInPlace $out/autoload/copilot/agent.vim \
--replace " let node = get(g:, 'copilot_node_command', ''\'''\')" \
" let node = get(g:, 'copilot_node_command', '${nodejs}/bin/node')"
'';
});
cpsm = super.cpsm.overrideAttrs (old: {
nativeBuildInputs = [ cmake ];
buildInputs = [