Closed sxyazi closed 1 year ago
You should probably set your home
directory to /Users/xxx
in your nix-darwin configuration. I'm not sure how anything would work without it.
Hmm, it seems like Home Manager's homeDirectory
defaults to $HOME
if the stateVersion is < 20.09. @rycee maybe we should skip the check in this situation?
Wow, It works after setting users.users.xxx.home
, thanks!
Not sure if it's a breaking change, my stateVersion
is 23.05.
Ouch. I'm not sure what the correct way to use nix-darwin is in this case. It seems you are expected to explicitly set the home directory? There doesn't seem to be an isNormalUser
option like in NixOS.
@LnL7 The default home directory of a user in nix-darwin seems to be set to /var/empty
, which I would guess is not the right choice except for some system users. I assume that regular users are expected have an explicitly set users.users.<name>.home
option?
We recently introduced a check in the Home Manager activation script that verifies that the user that the script is built for matches the user running the activation. This check led to this issue since @sxyazi had missed to set the home directory in the nix-darwin configuration.
The home directory option was originally introduced in https://github.com/LnL7/nix-darwin/commit/b8713d540c3928a800ea676f38643012c89a97dc and as far as I can tell it is mostly unchanged since then.
Perhaps nix-darwin could have something similar to NixOS's isSystemUser
and isNormalUser
flags to help user's get the right home directory configuration?
Thanks for the clear elaboration, so far it looks like setting users.users.xxx.home
is the best way. I will wait a while to close the issue and see if anyone else also having the issue.
If so I will file an issue for nix-darwin and ask them to add the isSystemUser
and isNormalUser
flags, but this may not happen soon as nix-darwin is currently in a lack of maintenance situation.
@sxyazi I had the same problem after updating flakes just now. For now I used the users.users.xxx.home
setting and it worked 🤷♂️
Are you following the right branch?
Is there an existing issue for this?
Issue description
I encountered the error when I rebuilt after updating.
It's supposed to be caused by https://github.com/nix-community/home-manager/commit/6a1922568337e7cf21175213d3aafd1ac79c9a2e. I'm on the Darwin system.
Maintainer CC
@rycee
System information