Confirmed that VSCode Remote-WSL extension works with NixOS

Now that WSL 2 (Windows Subsystem for Linux) has been released from Windows 2004 update, NixOS can be run in Windows machine :tada:
I quickly searched for a way to develop with VSCode Remote-WSL extension, which makes it possible to develop within Windows while testing & running in NixOS, in a single machine. However, no one has posted about this, so I decided to quickly share how I managed to build the environment.

Quick guide to work with Remote-WSL:

What I found out:

  • This one works: GitHub - Trundle/NixOS-WSL: NixOS on WSL(2) (and also thanks for mentioning it here) However it required some tweaks to make it work with VSCode.
  • Currently there aren’t any Remote-SSH specific nor Remote-WSL specific issues. They share same issues, posted in this thread. You can refer to that thread if you want another solution other than mine.

Hi!! Nice post, the last time I tried using Remote-SSH in my hyper-v, vscode cannot always detect because of this issue:

I’ll try this today. Thanks again!

That’s outstanding… It would have never happened in the Guix world…

That’s really cool @sonowz ! Thanks you for testing and sharing this! :smiley:

I’m going to try it against the redistributable NixOS version I’ve forked ( /

I’ll see if I can integrate it directly inside the redistributable version.

We’re getting closer on NixOS support over Windows :smiley: