Run nix in a lightweight chroot container
Go to file
Luca Bruno 809dda7f0a Merge pull request #6 from Mic92/master
support for TMPDIR variable
2016-08-29 11:14:07 +01:00
main.c support for TMPDIR variable 2016-08-29 11:56:09 +02:00
Makefile Initial commit 2015-06-24 18:07:09 +02:00
README.md Mention user namespace requirement. Closes #4 2016-04-02 14:07:48 +02:00

Run nix as user in a lightweight chrooted container.

$ mkdir -m 0755 ~/nix && chown $(whoami) ~/nix
$ nix-user-chroot ~/.nix sh
$ download and extract latest nix binary tarball
$ nix-*-linux/install

You are in a user chroot where / is owned by your user, hence also /nix is owned by your user. Everything else is bind mounted from the real root.

Notes:

  • The nix config is not in /etc/nix but in /nix/etc/nix, so that you can modify it. This is done with the NIX_CONF_DIR, which you can override at any time.
  • It requires user namespaces, at least Linux 3.8.