Spot an error? Know how to make this page better? I appreciate pull requests.

Nix within WSL

The comfort of Nix, even within Windows

Installing Nix in WSL (Ubuntu)

Attempting to install nix while in WSL returns some obtuse errors.

Missing cgroups support

The Nix sandbox relies on container functionality that Windows has yet to implement in the WSL abstraction layer. If you do not disable the sandbox the follow error occurs.

Incorrect file locking

The lock handling in Windows NT doesn’t perfectly match Linux’s. While SQLite works fine under the Win32 personality, it produces deadlocks when you try to install Nix, producing this infinite warning loop:

Installing Nix

Adding the following to /etc/nix/nix.conf before installing nix allows for workarounds the allow a successful installation.

Now Run the Nix Package Manager Install script and you will have a successful install.