In my experience, the nix --store
option is not very well tested and tends to break between releases. So wrapping the whole nix process in a chroot seems like a better option until a proper test suite is added to Nix.
There are two other related projects in the same space:
-
https://github.com/matthewbauer/nix-bundle: has it’s own nix-user-chroot implementation. That project is also used by default when invoking
nix bundle
in the new 2.4 CLI. - GitHub - nix-community/nix-user-chroot: Install & Run nix without root permissions [maintainer=@Mic92] - Is a rewrite in rust by @Mic92
Overall, using bubblewrap or another well-tested technology seems like a good idea. I need to test that out as I wanted to solve the bootstrap problem for the devshell project.