On some Linux distributions this may initially fail and request you to run some commands as root to enable kernel.unprivileged_userns_clone.
This also requires the kernel support CONFIG_USER_NS support in kernel which was introduced in kernel 3.3
If sudo is available, running these two commands should work:
sudo sysctl -w kernel.unprivileged_userns_clone=1
sudo sh -c "echo kernel.unprivileged_userns_clone=1 > /etc/sysctl.d/nix-user-chroot.conf"