Commit 9821e338 authored by Florian Beeres's avatar Florian Beeres
Browse files

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.
parent 20a99ed3
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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 = [