I am using Nix to create a developer shell environment where certain environment variables are set to properly compile my projects. Instead of installing these globally, I like to keep them confined within a nix configuration file per project.
The issue I am bumping into is that Cursor does something different from VSCode.
When I launch VSCode from the terminal by doing code .
in my terminal, the editor will have the environment variables inherited, e.g. PKG_CONFIG_PATH
. However, cursor .
does not do the same for at least that specific environment variable.
This leads to errors within my editor for my Rust language server like this:
The system library `gdk-3.0` required by crate `gdk-sys` was not found.
The file `gdk-3.0.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
PKG_CONFIG_PATH contains the following:
- /usr/lib/pkgconfig
Somehow the PKG_CONFIG_PATH
is overridden in Cursor.