I installed nix on a ubuntu server to have my environment which include nushell. The installation went well (after some headache) and I defined the shell with /etc/shell and chsh -s /home/user/.nix-profile/bin/nu but then it doesn’t have the full path. And both zoxide and nix are known command. But this works if, from that shell, I do bash then nu. So if I go through bash and recreate a shell nu.
Isn’t that hwo I’m supposed to define the user shell ?
I’m not aware of any shell that just automagically knows how to search some nix profile path for executables. This job generally falls to a shell profile script/hook (which sets up the PATH along with a few other envs).
The install script will modify the first writable file from amongst .bash_profile, .bash_login and .profile to source ~/.nix-profile/etc/profile.d/nix.sh. You can set the NIX_INSTALLER_NO_MODIFY_PROFILE environment variable before executing the install script to disable this behaviour.
or
The installer will modify /etc/bashrc, and /etc/zshrc if they exist. The installer will first back up these files with a .backup-before-nix extension. The installer will also create /etc/profile.d/nix.sh.