Stream: beginners

Topic: Error starting code in nix flake on WSL


view this post on Zulip Brian Teague (Feb 06 2024 at 18:40):

I need some help trying to get VSCode to start on Debian in Windows WSL.
After running nix develop, cd into roc repo, I get the following error message when running code .

To use Visual Studio Code with the Windows Subsystem for Linux, please install Visual Studio Code in Windows and uninstall the Linux version in WSL. You can then use the code command in a WSL terminal just as you would in a normal command prompt.
Do you want to continue anyway? [y/N]

Running code works fine outside of nix develop as I have the WSL extension installed.

view this post on Zulip Anton (Feb 06 2024 at 19:30):

Does continue anyway? [y] work?

view this post on Zulip Brian Teague (Feb 06 2024 at 19:51):

No, it doesn't do anything after typing y

view this post on Zulip Brian Teague (Feb 06 2024 at 19:51):

If I type exit to quite the nix develop environment and type code ., then it works, but then I'm no longer using the nix flake.

view this post on Zulip Brian Teague (Feb 07 2024 at 03:07):

I figured it out. Nix will override environment variables if they are set ahead of time. The following command will work.
DONT_PROMPT_WSL_INSTALL=true code .


Last updated: Jul 05 2025 at 12:14 UTC