Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra permissions change needed to install x86-64 brew packages #31

Open
ian-h-chamberlain opened this issue Jul 30, 2024 · 0 comments
Open

Comments

@ian-h-chamberlain
Copy link

ian-h-chamberlain commented Jul 30, 2024

After activating on a fresh install with enableRosetta = true and trying to install a package under x86_64, I got this error:

$ arch -x86_64 brew install bazelisk 
Error: The following directories are not writable by your user:
/usr/local/bin

You should change the ownership of these directories to your user.
  sudo chown -R ichamberlain /usr/local/bin

And make sure that your user has write permission.
  chmod u+w /usr/local/bin

Looking at the directory it complained about, it seems possible that /usr/local/bin existed prior to homebrew installation due to my organization's device management software:

$ ls /usr/local/bin/
total 0
drwxr-xr-x   4 root  wheel   128B Jul 30 15:12 ./
drwxr-xr-x  16 root  wheel   512B Jul 24 15:07 ../
lrwxr-xr-x@  1 root  wheel    48B Jul 30 15:12 brew@ -> /nix/store/6rc2ik8cfijm7874xwd93ccqzvs7nv0m-brew
lrwxr-xr-x   1 root  wheel    24B Jul 18 15:56 jamf@ -> /usr/local/jamf/bin/jamf

Performing the recommended steps worked and I was able to continue installation, but are my changes likely to get wiped out the next time nix-homebrew is activated? Is this something the activation script would be expected to do itself (i.e. perform those chown/chmod steps on the bin directory if it existed prior to the activation script running)?

Please let me know if there's any extra info I can provide, I can probably try to reproduce by nuking the whole homebrew installation and trying again, maybe also by manually setting permissions back to how they were...


Edit: semi-related question, is there a simple way to declare nix-darwin's homebrew.brews for multiple prefixes at the same time when using nix-homebrew? It seems like it only supports one brewPrefix by default, so I guess I'd need to write my own activation script if I wanted to also install packages under a second prefix with enableRosetta = true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant