nix-darwin icon indicating copy to clipboard operation
nix-darwin copied to clipboard

sudo: /private/etc/sudoers.d/10-nix-darwin-extra-config is owned by uid 501, should be 0

Open PlumpMath opened this issue 1 year ago • 5 comments
trafficstars

hello.

sudo: /private/etc/sudoers.d/10-nix-darwin-extra-config is owned by uid 501, should be 0

How can I avoid typing commands like the following? I'm just managing macOS installed on an external hard drive. This issue is related to Apple and money. 😅

sudo chown -R root:wheel /nix/var/nix/db

sudo chown -R $USER:staff /nix/store

PlumpMath avatar Feb 12 '24 14:02 PlumpMath

#888 should mean that that file won't exist unless you have the security.sudo.extraConfig option set.

But it never should have been owned by you instead of root anyway, since it uses environment.etc internally. Sounds like an issue with external drives rather than this specific file

Samasaur1 avatar Mar 01 '24 02:03 Samasaur1

The priority for Macs is to get rid of the hard drive. https://github.com/NixOS/nix/issues/3435#issuecomment-1257073693

/private/etc/sudoers.d/10-nix-darwin-extra-config /etc/sudoers.d/10-nix-darwin-extra-config ?

In both problematic and non-problematic Macs, the two files do not exist. If I were in this situation, what should I add to the security.sudo.extraConfig option to resolve the issue? Reinstalling does not fix the problem, as it persists every time.

PlumpMath avatar Mar 01 '24 15:03 PlumpMath

I'm not exactly sure what your issue is, but if you update nix-darwin and don't have the security.sudo.extraConfig set to anything, that file should disappear

Samasaur1 avatar Mar 02 '24 09:03 Samasaur1

https://github.com/NixOS/nix/issues/10421#issuecomment-2041619295

PlumpMath avatar Aug 01 '24 16:08 PlumpMath

Is there a way to install macOS and the Nix daemon on the Mac’s original hard drive as usual, but install all additional Nix stores on an external hard drive? On Linux systems other than NixOS, I’ve been solving this issue by moving the Nix store to another location and running the following script at every reboot:

mkdir -pv /nix
mount --bind /home/user/new-nix-store /nix

I hope that a similar solution could resolve the multi-user issue on macOS. To achieve this, we might need a way to bypass mounting /nix on a new volume of APFS. Does anyone know how to do this?

If such an option is added to the Nix installer for macOS, it would perfectly solve the issue.

PlumpMath avatar Aug 01 '24 17:08 PlumpMath