You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a standard Debian 12.11 image, nix is not available inside tmux shells. This is because the Nix profile bin directories are not on the PATH, because the PATH gets reset in /etc/profile, but __ETC_PROFILE_NIX_SOURCED is inherited.
Steps To Reproduce
Start from a stock Debian Bookworm (current: 12.11) image.
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon with default options.
Reboot for good measure.
Observe that nix --version succeeds on user's login shell, but not after tmux.
Expected behavior
I expect nix to be available, and any other executables in the profile. However, they are not, as /home/$USER/.nix-profile/bin:/nix/var/nix/profiles/default/bin are not prepended to $PATH in the inner shell.
This is because in /etc/profile, PATH is reset as follows:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ "$(id -u)" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH
[…]
Yet __ETC_PROFILE_NIX_SOURCED=1 is inherited from the parent shell, so /etc/profile.d/nix.sh -> /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh returns immediately.
Since this is a very basic setup (no customisations made to the stock Debian install), I just expect this to work.
Metadata
nix-env (Nix) 2.29.0
The text was updated successfully, but these errors were encountered:
Describe the bug
On a standard Debian 12.11 image,
nix
is not available insidetmux
shells. This is because the Nix profilebin
directories are not on the PATH, because the PATH gets reset in/etc/profile
, but__ETC_PROFILE_NIX_SOURCED
is inherited.Steps To Reproduce
sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon
with default options.nix --version
succeeds on user's login shell, but not aftertmux
.Expected behavior
I expect
nix
to be available, and any other executables in the profile. However, they are not, as/home/$USER/.nix-profile/bin:/nix/var/nix/profiles/default/bin
are not prepended to$PATH
in the inner shell.This is because in
/etc/profile
,PATH
is reset as follows:Yet
__ETC_PROFILE_NIX_SOURCED=1
is inherited from the parent shell, so/etc/profile.d/nix.sh
->/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
returns immediately.Since this is a very basic setup (no customisations made to the stock Debian install), I just expect this to work.
Metadata
nix-env (Nix) 2.29.0
The text was updated successfully, but these errors were encountered: