Replies: 2 comments 2 replies
-
Thanks so much for the in-depth research & write-up. This is surely going to help a lot of people! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks a bunch! Using the {...}: {
xdg = {
desktopEntries = {
codium = {
name = "VSCodium";
type = "Application";
categories = ["Utility" "TextEditor" "Development" "IDE"];
comment = "Code Editing. Redefined.";
exec = ''sh -c "LD_LIBRARY_PATH=\\$NIX_LD_LIBRARY_PATH codium --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WaylandWindowDecorations"'';
genericName = "Text Editor";
icon = "vscodium";
mimeType = ["x-scheme-handler/vscode"];
noDisplay = false;
startupNotify = true;
terminal = false;
};
};
};
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After having some issues with the NX Console plugin in VSCode and solving it, I thought that I should share my findings here for anyone else experiencing the same issue.
The issue I had was that the NX Console client failed to start when starting VSCode, and the console gave me the following output:
I verified that the package it tried to import in fact was installed in
~/.vscode-insiders/extensions/nrwl.angular-console-18.17.0/node_modules/@parcel/watcher-linux-x64-glibc
, so I thought that it could be an issue with running the binary. Since the parcel watcher is a C++ binary that uses dynamic linking to load system libraries during runtime, this was likely the case. I did some cleanup:~/.vscode-insiders/extensions/nrwl.angular-console-18.17.0
was properly removed)LD_LIBRARY_PATH
was not set when starting vscode though the terminal (unset LD_LIBRARY_PATH
. In my case, a pipewire setting in NixOS had set the variable, which could cause issues in steps further down)Now I started getting another error:
Error: libstdc++.so.6: cannot open shared object file: No such file or directory
Verified the issue by running
ldd ~/.vscode-insiders/extensions/nrwl.angular-console-18.17.0/node_modules/@parcel/watcher-linux-x64-glibc/watcher.node
which gave me:Right, so the NixOS link-loader is missing a C++ library. Here are two ways of solving this:
I already had nix-ld-rs set up on my system. I used the maintainers dotfiles for reference: https://github.com/Mic92/dotfiles/blob/main/nixos/modules/nix-ld.nix.
nix-ld
will however not automatically fix the parcel binary for us, because it is run from nodenix-ld
won't be used. I am still exploring the best way to scope vscode extensions to using theNIX_LD_LIBRARY_PATH
without setting the it for subprocesses, like shells within VSCode. Right now, I am doing this:LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
code-insiders ...`LD_LIBRARY_PATH
when a shell open. I usedirenv
to automatically load development environments, so it's as easy as addingunset LD_LIBRARY_PATH
into the.envrc
fileThe permanent solution should probably be to contribute to https://github.com/nix-community/nix-vscode-extensions and make sure that the libstdc++.so.6 library is bundled with VSCode whenever the NX Console extension is installed.
Feel free to provide feedback or discuss other solutions to the issue below.
Beta Was this translation helpful? Give feedback.
All reactions