-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
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
$HOMEstill 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.
- It's tracked as a known issue in the upstream Nix repository (Running Nix with
sudoon darwin now complains that/Users/lilyisn't owned by me NixOS/nix#6834) - The Nix commands being run (nix-env for setting the system profile) shouldn't actually care about
$HOMEat all - The issue remains open and unresolved
craigjperry2 and jukremer
Metadata
Metadata
Assignees
Labels
No labels