nix-user-chroot icon indicating copy to clipboard operation
nix-user-chroot copied to clipboard

Command to run comes from outside chroot

Open DavidTruby opened this issue 5 years ago • 3 comments

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.

DavidTruby avatar Sep 02 '19 10:09 DavidTruby

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:

DavidTruby avatar Sep 03 '19 10:09 DavidTruby

Have you tried using the full path to the executable? i.e.: ~/.nix-profile/bin/bash

Mic92 avatar Sep 03 '19 14:09 Mic92

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.

EggBaconAndSpam avatar Nov 15 '19 15:11 EggBaconAndSpam