4 ms·
I don't recommend using Nix inside PRoot unless this is your only option (e.g.: Android, since there are no user namespaces). The reason for that is that Nix is
by kokada 2y ago
I don't recommend using Nix inside PRoot unless this is your only option (e.g.: Android, since there are no user namespaces). The reason for that is that Nix is syscall heavy and using it in PRoot will be slow, really slow.
As someone said, the wiki [1] has some interesting options. From the options I used nix-user-chroot [2] with great success, and while the tool is unmaintained it should still work. It uses Linux's user namespaces instead of intercepting syscalls, and this makes the performance pretty much identical to native.
If you want more control like PRoot offers, I recommend bubblewrap instead [2].
Another option undocumented is to just grab a recent nix binary somewhere and run. It will automatically create the Nix store inside `$HOME/.local/share/nix` (if I am not mistaken) and use user namespaces to mount to it. However the last time I tried this didn't work well for a few things (e.g.: Home-Manager), so in general I still think nix-user-chroot is a better choice.
[1]: https://wiki.nixos.org/wiki/Nix_Installation_Guide https://wiki.nixos.org/wiki/Nix_Installation_Guide, linking to the official one
[2]: https://github.com/containers/bubblewrap https://github.com/containers/bubblewrap
[3]: https://wiki.nixos.org/wiki/Nix_Installation_Guide#nix-user-chroot https://wiki.nixos.org/wiki/Nix_Installation_Guide#nix-user-...