- This note is about how to install NixOS as a distribution on WSL.
- This note is different from setting up Nix on WSL (which is more about how to set up Nix on any WSL Linux distro).
- Link to official repo.
Installation
Make sure to run all the following commands from PowerShell. Link to official installation document.
-
Enable WSL if you haven’t done already:
wsl --install --no-distribution -
DownloadÂ
nixos.wsl from the latest release. -
If you have WSL version
2.4.4or later installed (wsl --version, you can open (double-click) the.wslfile to install it. It is also possible to perform the installation from a PowerShell:wsl --install --from-file nixos.wslnixos.wsl must be the path to the file you just downloaded if you’re running the command in another directory. -
Run the distro:
wsl -d NixOS
