Open montchr opened 1 year ago
Also, for reference, here's the output of brew shellenv
on my aarch64-darwin
system:
❯ brew shellenv
export HOMEBREW_PREFIX="/opt/homebrew";
export HOMEBREW_CELLAR="/opt/homebrew/Cellar";
export HOMEBREW_REPOSITORY="/opt/homebrew";
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}";
export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:";
export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}";
@malob any thoughts on this issue? I'm not too familiar as I don't personally use brew
I think this would be reasonable but it would be a breaking change that we'd have to handle or warn about somehow. (Error out when the prefix ends with /bin
?)
I just realized the "fix" I committed in my personal config (visible in history above) results in a $MANPATH
that does not include anything managed by Nix.
I hadn't noticed until I couldn't find an rsync
option that I know exists but was not found in its manpage. While rsync --version
says 3.2.7, turns out that the manpage I get from man rsync
is for rsync
@2.6.9 (the version included in macOS).
@montchr This issue goes beyond nix-darwin (I haven't yet installed nix-darwin), but I brought this up in the nix installer here https://github.com/DeterminateSystems/nix-installer/issues/715 (not sure if that was the right place).
The
brewPrefix
value defaults to/opt/homebrew/bin
or/usr/local/bin
, which is a bit misleading considering that the "prefix" should refer to the next level up (/opt/homebrew
or/usr/local
), which also happens to align with the output ofbrew --prefix
.This confusing terminology has bitten me a couple times when setting
environment.systemPath = ["${config.homebrew.brewPrefix}/bin"]
, which results in the unexpected (and potentially shell-breaking) value of/opt/homebrew/bin/bin
added to$PATH
. Also, side note: shouldn't that value be added to$PATH
automatically ifconfig.homebrew.enable == true
(or at least make that an option)?From brew(1):
And from GNU Autoconf documentation:
Also see: