You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following issue where some of my python-related extensions I have installed fail with the following error:
[info] cannot execute [project_dir]/.venv/bin/python: You are trying to run an unpatched binary on nixos, but you have not configured NIX_LD or NIX_LD_x86_64-linux. See https://github.com/Mic92/nix-ld for more details
Launching code from the system launcher results with this issue, but my extensions work when launching vscode from the terminal (code .).
I have uv installed via its installer (uv sorta acts like rustup and cargo but for python). The python binaries installed using uv work just fine when running from the command line. However, the vscode extensions that use the local .venv/bin/python fail with that error. They fail because vscode doesn't set NIX_LD when run from the system launcher, but running code from the command line keeps the environment variables and allows the extensions to work. I can confirm the issue is with NIX_LD with the following test.
code .# Extensions work
NIX_LD="" code .# They do not work
I'm opening this issue for a couple of reasons.
I could not find anything related to this specific issue anywhere else, so hopefully this will help someone in the future.
Is there a way to have certain applications run using the nix-ld shims and, more importantly, is that a recommended solution? I've seen nix-shell being recommended as the way to launch shells with certain environment variables and other config set up to work with certain things, but I don't need that since launching code from my normal shell works perfectly well.
The text was updated successfully, but these errors were encountered:
Can you please make sure you have the latest version of nix-ld? Since nix-ld 2.0, we should no longer need NIX_LD/NIX_LD_LIBRARY_PATH because nix-ld will fallback to /run/current-system/sw/share/nix-ld/lib/ and /run/current-system/sw/share/nix-ld/lib/ld.so.
I guess I'm using nix-ld 1.2.3, based on nix-store -q. I am considering updating nixpkgs to unstable anyways, so I'll do that when I have some free time. NixOS is still more of an experiment for me. :)
(Perhaps I should really open an issue with
nixpkgs
, but I'm not entirely certain where the problem needs to be fixed, and I'm still new to nix)Here's a summary of my
configuration.nix
.I get the following issue where some of my python-related extensions I have installed fail with the following error:
Launching code from the system launcher results with this issue, but my extensions work when launching vscode from the terminal (
code .
).I have
uv
installed via its installer (uv
sorta acts likerustup
andcargo
but for python). The python binaries installed usinguv
work just fine when running from the command line. However, the vscode extensions that use the local.venv/bin/python
fail with that error. They fail because vscode doesn't setNIX_LD
when run from the system launcher, but runningcode
from the command line keeps the environment variables and allows the extensions to work. I can confirm the issue is withNIX_LD
with the following test.I'm opening this issue for a couple of reasons.
nix-ld
shims and, more importantly, is that a recommended solution? I've seennix-shell
being recommended as the way to launch shells with certain environment variables and other config set up to work with certain things, but I don't need that since launchingcode
from my normal shell works perfectly well.The text was updated successfully, but these errors were encountered: