Nix Installation Guide: Difference between revisions
imported>Mic92 improve check if userns is available. |
imported>Mic92 switch to rust version of nix-user-chroot |
||
Line 45: | Line 45: | ||
=== nix-user-chroot === | === nix-user-chroot === | ||
[https://github.com/ | [https://github.com/nix-community/nix-user-chroot nix-user-chroot] is the preferred method to install use nix on systems without <code>/nix</code>. It also requires user namespaces to be enabled on the system. | ||
<code>nix-user-chroot</code> will create an environment in which you can bind mount an directory to <code>/nix</code>. | <code>nix-user-chroot</code> will create an environment in which you can bind mount an directory to <code>/nix</code>. | ||
The mountpoint will be only visible within this environment. | The mountpoint will be only visible within this environment. | ||
There are [https://github.com/nix-community/nix-user-chroot/releases pre-build static binaries] | |||
and the readme also contains the instructions to build from [https://github.com/nix-community/nix-user-chroot#build-from-source source] (assuming rustc and cargo to be installed). | |||
In this example, the Nix store will be installed to <code>~/.nix</code>. | In this example, the Nix store will be installed to <code>~/.nix</code>. | ||
Line 73: | Line 56: | ||
<syntaxHighlight lang="console"> | <syntaxHighlight lang="console"> | ||
$ mkdir -m 0755 ~/.nix | $ mkdir -m 0755 ~/.nix | ||
$ | $ nix-user-chroot ~/.nix bash | ||
</syntaxHighlight> | </syntaxHighlight> | ||