Repository navigation
nix, xdg/systemDirs: declare search paths as search variables - #9858
Open
khaneliman wants to merge 3 commits into
Open
khaneliman wants to merge 3 commits into
khaneliman wants to merge 3 commits into
Conversation
khaneliman
force-pushed
the
session-vars-1-search-vars
branch
from
August 28, 2026 06:17
2d429dd to
4fd0020
Compare
khaneliman
force-pushed
the
session-vars-1-search-vars
branch
5 times, most recently
from
August 29, 2026 02:55
2e47fea to
9d5f688
Compare
khaneliman
marked this pull request as ready for review
August 29, 2026 02:56
khaneliman
force-pushed
the
session-vars-1-search-vars
branch
from
September 9, 2026 22:13
9d5f688 to
65d8582
Compare
4 of 5 tasks
khaneliman
changed the base branch from
generic-linux-source-nix-once
to
master
September 11, 2026 03:12
khaneliman
force-pushed
the
session-vars-1-search-vars
branch
from
September 11, 2026 03:12
65d8582 to
ccb75bf
Compare
khaneliman
force-pushed
the
session-vars-1-search-vars
branch
2 times, most recently
from
October 1, 2026 02:11
b7375cd to
7738360
Compare
Read inherited search-variable values through `${VAR-}` so generated
files remain safe when sourced under `set -u`.
Preserve ordinary unset, empty, and inherited values. Add runtime
coverage and update the affected search-variable expectations.
`nix.nixPath` with `keepOldNixPath` produced a self-referential `home.sessionVariables.NIX_PATH`. Declare it through `home.sessionSearchVariables` instead. The generated value keeps the same search path without depending on the variable it defines. Order the module entries with `lib.mkAfter` so existing plain `home.sessionSearchVariables.NIX_PATH` entries retain their precedence.
`XDG_CONFIG_DIRS` and `XDG_DATA_DIRS` were self-referential `home.sessionVariables` values. Declare the shell side through `home.sessionSearchVariables`, which expands to the same search path. Order the module entries after existing plain search-variable contributions. This preserves the previous user, module, then inherited lookup order. `systemd.user.sessionVariables` is unchanged, so the `environment.d` output is byte-identical. Add a news entry covering these two names and `NIX_PATH`. A user value set through `home.sessionVariables` now becomes the trailing value instead of colliding with the module definition. The entry also documents list merging, `lib.mkForce`, and the separate `environment.d` behavior.
khaneliman
force-pushed
the
session-vars-1-search-vars
branch
from
November 18, 2026 01:13
7738360 to
14de174
Compare
This branch has not been deployed
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
NIX_PATH(undernix.nixPathwithkeepOldNixPath),XDG_CONFIG_DIRS, andXDG_DATA_DIRSwere defined as self-referentialhome.sessionVariablesvalues. This declares them throughhome.sessionSearchVariablesinstead, without depending on the variable beingdefined.
The shared search-variable generator now reads inherited values through a
default-safe expansion. Unset variables behave as empty under
set -u, so thisPR does not depend on a later stack layer for safe shell startup. Existing
plain
home.sessionSearchVariablesentries retain their precedence over themigrated module entries.
systemd.user.sessionVariablesis untouched, soenvironment.doutput isbyte-identical. One intentional compatibility change remains: a value set
through
home.sessionVariablesno longer collides with these moduledefinitions and instead becomes the trailing value. The news entry documents
list merging,
lib.mkForce, exact-value migration, and the separateenvironment.dbehavior.Part of splitting #9735 into independently reviewable changes; the stack as a
whole supersedes that PR.
Checklist
names now compose with the module entries; a news entry is included.)
nix fmt.{component}: {description}format.