Nix Installation Guide: Difference between revisions

imported>HaoZeke
Updated the filename.
imported>Drewrisinger
Instructions on Installing Nix on WSL
Line 179: Line 179:




== Windows Subsystem for Linux (WSL) ==
As of Windows 10, Microsoft supports running Linux and Linux programs on the Windows OS. Installation instructions can be found at [https://docs.microsoft.com/en-us/windows/wsl/install-win10]. If you follow those instructions for using WSL2 (post-Windows 10 2004 build 19041), you can install Nix normally as described in [[Nix_Installation_Guide#Single-user_install|Single-user install]]. You can check what version of WSL you are using by running <code>wsl --list --verbose</code> from the Windows command line.
=== WSL1 (pre-Windows 10 2004 build 19041) ===
Running Nix is much simpler on WSL2, so we recommend that if at all possible. If WSL2 is not available, then Nix can be installed and run from WSL1 with a few workarounds.
If you perform no workarounds, you will see that <code>busybox</code> doesn't work in Nix due to WSL1 not handling 32-bit binaries. This can be remedied by following the solution laid out in [https://github.com/NixOS/nixpkgs/issues/24954#issuecomment-399614154 nixpkgs issue#24954]:
* Install and configure QEMU and binfmt-support
<syntaxHighlight lang="console">
$ sudo apt install qemu-user-static
$ sudo update-binfmts --install i386 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xf8\xff\xff\xff\xff\xff\xff\xff'
</syntaxHighlight>
* Start the <code>binfmt-support</code> service every WSL1 login:
<syntaxHighlight lang="console">
$ sudo service binfmt-support start
</syntaxHighlight>
* Continue installing Nix as described in [[Nix_Installation_Guide#Single-user_install|Single-user install]]


== ARMv7l ==
== ARMv7l ==


Because there is no officially produced ARMv7l installer, this page describes how to build your own: [[Nix_on_ARM]].
Because there is no officially produced ARMv7l installer, this page describes how to build your own: [[Nix_on_ARM]].