nix-user-chroot
nix-user-chroot copied to clipboard
Command to run comes from outside chroot
The binary to run seems to come from the host system not the chroot, i.e. if I install a shell with nix (e.g zsh which my system doesn't have installed) and then try and run that with nix-user-chroot ~/.nix zsh, the command can't be found. Preferably I would be able to manage my shell with nix and run it this way.
It tried naively to fix this myself (by just checking if the binary to run exists in the target nix directory, and using the one from the host if not) but I ran into lots of problems with locales and permissions. So, I probably don't know enough about this to fix it or even if it's an issue in the first place :smiley:
Have you tried using the full path to the executable?
i.e.: ~/.nix-profile/bin/bash
Is this possibly related to #12? More specifically, nix-user-chroot ~/.nix zsh
inherits the PATH environment from its host shell, which doesn't contain ~/.nix-profile/bin
and thus also not zsh
.