I am trying to use the GitHub Copilot plugin for Neovim which is already available from Nixpkgs as copilot-vim. After installation, running the plugin with :Copilot setup gives me Copilot: 'Node.js not found in PATH'.
I thought I could just add NodeJS through an overlay, like this:
(final: prev: {
copilot-vim = prev.copilot-vim.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++ [prev.nodejs];
buildInputs = old.buildInputs ++ [prev.nodejs];
});
})
But this doesn't make the error go away.
I know that I can just install NodeJS in whatever way. But my goal is to add NodeJS on PATH as a dependency to this plugin, rather than adding NodeJS in a decoupled fashion.
So,
buildInputsonly makes nodejs available during the build. But if the build output does not end up with a reference to nodejs, it won't be there in the finished package. Looking at the code tocopilot-vim, it seems you would want to patch this line:to have your included node version as the default.
I would probably do something like this: