nix-darwin
nix-darwin copied to clipboard
darwin-rebuild should use `sudo -H` instead of `sudo` to work around Nix warning
Nix 2.10 has started printing a warning whenever the current user doesn't own $HOME
, which is the case on macOS when running sudo nix
because macOS sudo
doesn't reset $HOME
by default. darwin-rebuild
is currently running sudo nix-env -p "$profile" --set "$systemConfig"
. This command shouldn't care about $HOME
[^1] and yet it now triggers a warning. It would be nice to avoid the warning.
[^1]: In theory $HOME
can affect it through per-user nix.conf
files but that seems rather niche.