Skip to content

Remove $XDG_STATE_HOME/nix/profiles/home-manager from default installables#137

Open
reasonableperson wants to merge 1 commit intoutdemir:mainfrom
reasonableperson:main
Open

Remove $XDG_STATE_HOME/nix/profiles/home-manager from default installables#137
reasonableperson wants to merge 1 commit intoutdemir:mainfrom
reasonableperson:main

Conversation

@reasonableperson
Copy link

@reasonableperson reasonableperson commented Mar 10, 2026

The default behaviour of nix-tree on my system is confusing. According to nix-tree --help, the default store paths are ~/.nix-profile and /var/run/current-system. However, in #110, an additional path, $XDG_STATE_HOME/nix/profiles/home-manager, was added.

I am using home-manager standalone with flakes. As I understand it, running home-manager switch creates a profile which is symlinked to $XDG_STATE_HOME/nix/profiles/home-manager, and "activates" it by running nix profile install. This means that the current user profile at ~/.nix-profile contains your home-manager configuration as well as any other packages installed imperatively with nix profile. By default, nix-tree will display both ~/.nix-profile and $XDG_STATE_HOME/nix/profiles/home-manager. In the common case where there are no imperatively-installed packages, they will be almost identical and each will have an "added size" which is trivially small. This is confusing, especially on NixOS where the profile at /var/run/current-system is also displayed, because it suggests that the home-manager profile adds little to the system configuration. Plus, it's inconsistent with the help text.

I think the default behaviour should be as specified in the help text. If the user is using home-manager, it will be included in the tree of their current profile. The rationale seems to be that home-manager was doing "weird things" in #106, but I can't reproduce the observed behaviour of $XDG_STATE_HOME/nix/profiles/profile (the equivalent of ~/.nix-profile when use-xdg-base-directories is enabled) being a directory rather than a symlink, which as noted in #71 (comment), is contrary to the Nix documentation and may be a misconfiguration.

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.

1 participant