Skip to content

Conversation

@MichielDerhaeg
Copy link

This reverts commit 2b4e3fa.

This commit prevents PATH from being configured when a login shell is started nested in another login shell.

Linux distros might reset PATH when running a login shell (or when executing /etc/profile manually) but nix-daemon.sh will be skipped because __ETC_PROFILE_NIX_SOURCED will remain set. As a result PATH will no longer contain the path to the nix binary.

This PR fixes #13255 and #13355.
In my opinion it is better to have duplicates in your PATH than it not being set at all because nested login shells are used.

This reverts commit 2b4e3fa.

This commit prevents PATH (and other environment variables) from being
configured when a login shell is started nested in a other login shell.

Linux distros might reset PATH when running a login shell (or when
executing /etc/profile manually) but nix-daemon.sh will be skipped
because __ETC_PROFILE_NIX_SOURCED will remain set. As a result PATH will
no longer contain the path to the nix binary.
@MichielDerhaeg MichielDerhaeg changed the title Revert "nix-daemon: source nix-profile-daemon.sh only once" Allow nested login shells to retain nix in PATH Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nix not on PATH in tmux on standard Debian 12.11 multi-user install

1 participant