nixvim icon indicating copy to clipboard operation
nixvim copied to clipboard

Don't expose gcc on the PATH after starting nvim

Open aidigital opened this issue 1 year ago • 7 comments

The plugin rust-analyzer adds gcc to the $PATH. If we open a terminal inside neovim, and run cargo build/cargo test etc, it will fail if the project depends on various dynamically linked libraries (e.g. if using diesel, which links dynamically the C header files) because obviously the headers of those libs are outside /nix/store.

Fixes I've tried and worked:

  • manually remove the nix's gcc from the $PATH (but you have to do this in every terminal instance you open in neovim)
  • write build.rs to inform the compiler and linker where various system libs are installed

Fix I'm proposing:

  • don't expose the gcc from nix on the $PATH when starting neovim, if possible

I realise that gcc gets added to the $PATH by rust-analyzer, not by nixvim, but can still be removed by nixvim afterwards, unless there's a concern that doing so may break rust-analyzer.

aidigital avatar Mar 17 '24 20:03 aidigital