nix-darwin/Home-Manager - Error: HOME is set to "/Users/xxx" but we expect "/home/xxx"

Hi there,

I am just adopting nix-darwin (have nixos systems), and for some reason, I am getting:

setting nvram variables...
Activating home-manager configuration for dustin.krysak
Starting Home Manager activation
Error: HOME is set to "/Users/xxx" but we expect "/home/xxx"

Now I was searching for similar issues on the home-manager repo, and saw a few that were “very close,” and the fix was to set users.users.xxx.home of which I did.

My nixpkgs and home manager are set to 24.11, and if relevant, my nix darwin is set to system.stateVersion = 5; (fresh install).

My rebuild command is: darwin-rebuild switch --flake .#hostname. My understanding is that with nix-darwin and home manager, you can use either tool for rebuilds, but I could be incorrect.

I appreciate any direction you can give.

Cheers.

System information

output of nix shell github:NixOS/nixpkgs#nix-info --extra-experimental-features nix-command --extra-experimental-features flakes --command nix-info -m:


 - system: `"aarch64-darwin"`
 - host os: `Darwin 24.3.0, macOS 15.3.2`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.26.2`
 - nixpkgs: `not found`

That `nixpkgs` looks suspect to me, but I am not familiar yet with proper Darwin output.

No, you either use the nix-darwin module and darwin-rebuild OR standalone HM and home-manager CLI. Pick one of those methods and stick with it (semi-)permanently; do not mix the two.

I don’t have a darwin machine, but you’re more likely to get help if you share your config.

1 Like

I have not yet pushed to a remote repo, but you are correct. I am going to try a few more things. They other thing was that I was trying to integrate my darwin config into my main flake (alongside nixos), and I noticed in some of the nix-darwin blogs they have a specific darwin nixpkgs URL. I am currently tearing out into it’s own repo up until I get going. Then I can ask more effective questions.