Open azegas opened 2 months ago
I then found this message in the error:
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
so I added this to my nixos configuration:
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
and I did rebuild-switch.
When I tried to connect VsCode to NixOS WSL distro once again, I came to a different error message:
[2024-09-04 11:18:24.001] Extension version: 0.88.2
[2024-09-04 11:18:24.001] L10N bundle: undefined
[2024-09-04 11:18:24.056] authorityHierarchy: wsl+NixOS
[2024-09-04 11:18:24.056] WSL extension activating for a local WSL instance
[2024-09-04 11:18:24.066] Resolving wsl+NixOS, resolveAttempt: 1
[2024-09-04 11:18:24.066] NodeExecServer run: C:\WINDOWS\System32\wsl.exe --status
[2024-09-04 11:18:24.127] WSL feature installed: true (wsl --status)
[2024-09-04 11:18:24.128] NodeExecServer run: C:\WINDOWS\System32\wsl.exe --list --verbose
[2024-09-04 11:18:24.192] 4 distros found
[2024-09-04 11:18:24.193] Starting VS Code Server inside WSL (wsl2)
[2024-09-04 11:18:24.193] Windows build: 22631. Multi distro support: available. WSL path support: enabled
[2024-09-04 11:18:24.193] Scriptless setup: false
[2024-09-04 11:18:24.194] No shell environment set or found for current distro.
[2024-09-04 11:18:24.327] WSL daemon log file:
[2024-09-04 11:18:24.333] Probing if server is already installed: if [ -d ~/.vscode-server/bin/89de5a8d4d6205e5b11647eb6a74844ca23d2573 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf 'alpine-'; fi; if [ -s ~/.vscode-server/bin/compatibilty-check ]; then printf 'legacy-'; fi; uname -m;
[2024-09-04 11:18:24.333] NodeExecServer run: C:\WINDOWS\System32\wsl.exe -d NixOS -e sh -c if [ -d ~/.vscode-server/bin/89de5a8d4d6205e5b11647eb6a74844ca23d2573 ]; then printf 'install-found '; fi; if [ -f /etc/alpine-release ]; then printf 'alpine-'; fi; if [ -s ~/.vscode-server/bin/compatibilty-check ]; then printf 'legacy-'; fi; uname -m;
[2024-09-04 11:18:24.529] Unable to detect if server is already installed: Error: Failed to probe if server is already installed: code: Failed to probe if server is already installed: code: 127, /nix/store/qddh95vjifqqlvby19maszcapnm3jkhk-bash-interactive-5.2-p15/bin/sh: line 1: uname: command not found
[2024-09-04 11:18:24.529] , install-found legacy-
[2024-09-04 11:18:24.531] NodeExecServer run: C:\WINDOWS\System32\wsl.exe -d NixOS sh -c '"$VSCODE_WSL_EXT_LOCATION/scripts/wslServer.sh" 89de5a8d4d6205e5b11647eb6a74844ca23d2573 stable code-server .vscode-server --host=127.0.0.1 --port=0 --connection-token=896174925-43756493-2359005707-3392768951 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all'
[2024-09-04 11:18:24.853] Setting up server environment: Looking for /home/nixos/.vscode-server/server-env-setup. Found, executing...
[2024-09-04 11:18:24.853] == '~/.vscode-server/server-env-setup' SCRIPT START ==
[2024-09-04 11:18:24.853] Got vscode directory : /home/nixos/.vscode-server
[2024-09-04 11:18:24.853] If the directory is incorrect, you can hardcode it on the script.
[2024-09-04 11:18:24.853] Patching nodejs binaries...
[2024-09-04 11:18:25.768] Patching /home/nixos/.vscode-server/bin/89de5a8d4d6205e5b11647eb6a74844ca23d2573/node
[2024-09-04 11:18:25.769] path '/mnt/c/Users/arvydas/AppData/Local/Programs/Microsoft VS Code/nixpkgs.stdenv.cc.cc.lib' does not contain a 'flake.nix', searching up
[2024-09-04 11:18:25.769] error: getting status of '/mnt/c/Users/arvydas/AppData/Local/Programs/Microsoft VS Code/nixpkgs.stdenv.cc.cc.lib': No such file or directory
[2024-09-04 11:18:25.769] patchelf: getting info about '/home/nixos/.vscode-server/bin/89de5a8d4d6205e5b11647eb6a74844ca23d2573/node_modules/node-pty/build/Release/spawn-helper': No such file or directory
[2024-09-04 11:18:25.769] path '/mnt/c/Users/arvydas/AppData/Local/Programs/Microsoft VS Code/nixpkgs.stdenv.cc.cc.lib' does not contain a 'flake.nix', searching up
[2024-09-04 11:18:25.769] error: getting status of '/mnt/c/Users/arvydas/AppData/Local/Programs/Microsoft VS Code/nixpkgs.stdenv.cc.cc.lib': No such file or directory
[2024-09-04 11:18:26.069] == '~/.vscode-server/server-env-setup' SCRIPT END ==
[2024-09-04 11:18:26.069] WSL version: 5.15.153.1-microsoft-standard-WSL2 NixOS
[2024-09-04 11:18:26.113] WSL-shell-PID: 7425
[2024-09-04 11:18:26.113] Node executable: /home/nixos/.vscode-server/bin/89de5a8d4d6205e5b11647eb6a74844ca23d2573/node
[2024-09-04 11:18:26.113] Starting server: /home/nixos/.vscode-server/bin/89de5a8d4d6205e5b11647eb6a74844ca23d2573/bin/code-server --host=127.0.0.1 --port=0 --connection-token=896174925-43756493-2359005707-3392768951 --use-host-proxy --without-browser-env-var --disable-websocket-compression --accept-server-license-terms --telemetry-level=all
[2024-09-04 11:18:26.114] /home/nixos/.vscode-server/bin/89de5a8d4d6205e5b11647eb6a74844ca23d2573/node: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
[2024-09-04 11:18:26.114] For help with startup problems, go to https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
[2024-09-04 11:18:26.116] NodeExecServer run: C:\WINDOWS\System32\wsl.exe -d NixOS -e kill 7425
[2024-09-04 11:18:41.955] Download in background is enabled
[2024-09-04 11:19:11.970] Update check by another window detected, skipping.
Since you enabled flakes by this configuration:
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
could you try using flake version script rather than non-flake version? Non-flake version has not been tested for a long time :(
I'll look on non-flake version when I can (maybe after two weeks).
Hey!
I could use Ubuntu distro to open VsCode in, it works perfectly right out of the box, but I want to make it work wiht NixOS too!!
My nixos config currently lies here -
/etc/nixos/configuration.nix
I also did this step
cp ./server-env-setup ~/.vscode-server/server-env-setup
as you can see (usednon-flakes/server-env-setup
, since I don't use/know how to use flakes):What happens when I try to connect VsCode to NixOS WSL distro:
Full error message from VsCode (that you can see in the image above):
What am I doing wrong? :s
Thank you!