Home-manager insists on using .nix-profile

Hi there,

I am currently reworking my nixos flake (an unholy mess of WIP and copy/paste right now, so don’t judge :slight_smile: ) using snowfall. Everything is working pretty fine so far, system is up, home-manager is doing its thing.

The only issue I have been running into (so far) ist that home-manager insists on using the .nix-profile link in it’s .profile sourcing of the hm-session-vars.sh file.
My nix settings has use-xdg-base-directories = true; so the .nix-profile in my user’s $HOME doesn’t get created, which is what I expected (and want).

Looking at home-manager’s source,
from what I understand, it should use the .local/state/nix/profile link as its profileDirectory and further down the line add that to the .profile sourcing of hm-session-vars.sh.

Unfortunately, w/e I try, home-manager insists on using the .nix-profile instead of the .local/state/nix/profile link. Am I missing something here?

Thanks for any pointers!

I have a snowfall setup as well that works.

I think what you are missing is the home manager option to manage xdg.

So somewhere in a home-manager module (in your case user I would suggest) you should have

config.xdg.enable = true;

See home-manager options in Home Manager - Option Search

Hey mark,

thanks for the pointer, added the xdg.enable option and home-manager is putting the XDG_.... locations into the hm-session-vars.sh file.

Unfortunately, .profile is still trying to source from .nix-profile, so no dice :frowning:

Sorry, I have not seen that.

How are you rebuilding your configuration?

I would delete the .profile and try again. Also do you zsh files show the same issue?