Repository navigation
targets/generic-linux: source nix.sh once - #9857
Closed
khaneliman wants to merge 1 commit into
Closed
khaneliman wants to merge 1 commit into
khaneliman wants to merge 1 commit into
Conversation
khaneliman
force-pushed
the
generic-linux-source-nix-once
branch
2 times, most recently
from
August 28, 2026 19:45
2363414 to
bfc8228
Compare
khaneliman
marked this pull request as ready for review
August 28, 2026 20:22
khaneliman
force-pushed
the
generic-linux-source-nix-once
branch
from
September 9, 2026 21:44
bfc8228 to
9cb0625
Compare
Keep nix.sh inside the guarded session variables file to avoid duplicate PATH and XDG_DATA_DIRS entries on interactive Bash startup. Restore a missing profile bin directory after login PATH resets without moving an existing entry or replaying other session initialization. Exercise generated Bash startup with inherited guards for traditional and XDG profiles. Document the remaining environment recovery boundary.
khaneliman
force-pushed
the
generic-linux-source-nix-once
branch
from
September 9, 2026 21:50
9cb0625 to
cd2d6b2
Compare
4 of 5 tasks
Collaborator
Author
|
Folded into #9925 at the top of the stack. That change removes the direct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On generic Linux, Home Manager sources
nix.shthrough the guarded session variables file and directly from BashinitExtra. The direct call runs in interactive login and non-login shells. Sincenix.shis not idempotent, repeated Bash startup adds duplicatePATHandXDG_DATA_DIRSentries.Remove the direct call, but retain PATH recovery. Login initialization can reset
PATHwhile preserving__HM_SESS_VARS_SOURCED, so the guard does not guarantee that profile commands remain available. Bash now prepends the configured profile'sbindirectory only when it is missing. An existing entry keeps its position, preserving development-environment precedence.This does not replay
nix.shto recover other removed environment values. The news entry documents that remaining boundary; #9925 at the top of the stack removes it.Tests execute generated Bash startup files with an inherited guard and a reset PATH. They cover command lookup, repeated startup, and existing PATH precedence for traditional and XDG profiles. The existing counting test also checks that the guarded session file sources
nix.shonly once.This is a standalone bugfix at the bottom of the session-variable stack. Part of splitting #9735 into independently reviewable changes; the stack as a whole supersedes that PR.
Checklist
nix.shvalues changes; news entry included.)nix fmt.{component}: {description}format.