You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The warning is not caused by configuration - it's an expected behavior when using nix-darwin with modern versions of Nix (2.10.0+).
What's Happening
When nh darwin switch runs, it needs to execute certain commands with elevated privileges (via sudo). On macOS, sudo doesn't reset the $HOME environment variable by default, so:
Commands run as root (UID 0)
But $HOME still points to /Users/<username> (owned by the user, not root)
Starting in Nix 2.10.0, Nix added a check to verify that $HOME is owned by the current user. When it detects the mismatch, it issues this warning and falls back to using the home directory from the passwd file (/var/root for root).
Is It a Problem?
No. This warning is completely harmless and doesn't affect functionality. This warning is generated deep within the Nix core, not by nix-darwin itself.
The warning is not caused by configuration - it's an expected behavior when using nix-darwin with modern versions of Nix (2.10.0+).
What's Happening
When
nh darwin switchruns, it needs to execute certain commands with elevated privileges (via sudo). On macOS, sudo doesn't reset the$HOMEenvironment variable by default, so:$HOMEstill points to/Users/<username>(owned by the user, not root)Starting in Nix 2.10.0, Nix added a check to verify that
$HOMEis owned by the current user. When it detects the mismatch, it issues this warning and falls back to using the home directory from thepasswdfile (/var/root for root).Is It a Problem?
No. This warning is completely harmless and doesn't affect functionality. This warning is generated deep within the Nix core, not by nix-darwin itself.
sudoon darwin now complains that/Users/lilyisn't owned by me NixOS/nix#6834)$HOMEat all