Skip to content

fix(environment): export NIX_PROFILES for per-user and system profiles - #532

Open
XYenon wants to merge 1 commit into
numtide:mainfrom
XYenon:XYenon/531
Open

fix(environment): export NIX_PROFILES for per-user and system profiles#532
XYenon wants to merge 1 commit into
numtide:mainfrom
XYenon:XYenon/531

Conversation

@XYenon

@XYenon XYenon commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #531.

NixOS exports NIX_PROFILES from environment.profiles so shells (and Home Manager's zsh module) can find share/zsh/site-functions. system-manager only set PATH and XDG_DATA_DIRS, so packages from useUserPackages / users.users.<name>.packages / environment.systemPackages ran, but tab completion did not.

This is the same gap left after #505, which linked /share and wired desktop discovery but not NIX_PROFILES.

Key Changes

  1. Add environment.profiles: Match NixOS. users-groups.nix again contributes the user profile list ($HOME/.nix-profile, XDG state profile, /etc/profiles/per-user/$USER); system-manager appends /nix/var/nix/profiles/default and /run/system-manager/sw.
  2. Export NIX_PROFILES: Written to /etc/profile.d/system-manager-path.sh and /etc/environment.d/10-system-manager.conf in reverse profile order, plus NIX_USER_PROFILE_DIR.
  3. Tests: Assert NIX_PROFILES in login shells for the environment-variables, user-packages, and home-manager container tests.

NixOS exports NIX_PROFILES from environment.profiles so shells can find
share/zsh/site-functions. system-manager only set PATH and XDG_DATA_DIRS,
so Home Manager useUserPackages and users.users.<name>.packages binaries
worked but completions did not.

Fixes numtide#531
@mergify

mergify Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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_PROFILES omits per-user and system-manager profiles

1 participant