Ask HN: Homebrew, Asdf, Nix, or Other?

15 points by jahnu ↗ HN
New Macbook Air incoming and want to find out what the hive mind recommends for a fresh machine. On the old one I used Homebrew mostly but asdf for Ruby and Python. Was always happy with Apple Terminal + Oh My zsh. What’s your setup?

25 comments

[ 10.5 ms ] story [ 95.3 ms ] thread
Looks very cool!
It's beyond cool as it's fast, and very secure, and you can define your own formulas in place although the maintainer is very active of adding new packages within a couple of days!
Have been using asdf (with Ruby and JS) for years, haven't had a reason to look for something else yet.
I stopped using asdf as it's a huge security nightmare. Literally, you're running third-party Bash scripts, which have no checksums and absolute no security considerations! Even WordPress is better as it controls the source code of the standard plugins unlike asdf! Also, I often face an issue with GitHub IP quotas as each formula is on its own, often doesn't follow any basic security best practices or conventions, and does not use GITHUB_TOKEN to authenticate against the GitHub API. 90% of the plugin code for asdf is the same. I'm not sure why there's no basic framework that uses eget or other now-popular tools to fetch binaries for the proper arch from GitHub releases! That's why I use aqua [1], which just does this, and unlike asdf, is extremely fast as it has caching and downloads binaries in parallel.

[1]: https://aquaproj.github.io/

Asdf is great - I'm not knocking it at all and have built several scripts for it over the years - but I think mise might be a better tool for someone starting out from scratch: https://github.com/jdx/mise. These days I'm using nix, but it's not for everyone.
Yes, asdf just works for me. I can't recall a single issue in like 8 years of using it
Dont remember why, but I use mise for java versioning, and homebrew for app installation
Have you tried jenv? Similar tool to pyenv and rbenv.
What about using a linux VM and mount the directory that contains the source code in your mac so that you can edit it via your favourite editor/IDE?

I use multipass/qemu on my m2 and it works wonders. Another benefit is that I don’t run third party deps directly on my machine.

Another alternative is MacPorts. I've been using it since my first Mac (8 years ago), and haven't found a reason to change.
(comment deleted)
Just another datapoint but iterm2, zsh+ ohmyzsh, homebrew has been fine for ~10 years for me.

The main consideration I have is whether to manage languages via brew or via things like NVM for node, Pyenv for python etc.I don’t remember what I did for python but using poetry works flawlessly.

Homebrew because that's where most packages live, and what most documentation and stack answers point to.

Not worth fiddling with the other package managers. Homebrew just works and never gave me much of an issue.

I switched from asdf to mise - https://mise.jdx.dev/
What prompted you to switch?
The docs does a great job of comparing the two: https://mise.jdx.dev/dev-tools/comparison-to-asdf.html

Personally I didn't care about shims or performance. I find the asdf commands to be difficult to remember because they are unintuitive. See the "UX" section of the link above.

Thanks I didn't see that before!

  you can't use latest:20 in a .tool-versions file or many other places
This has always bugged me in asdf where I just want to say something like python:3.11.* where I don't care about the patch version number just that some 3.11 version is used.
Homebrew is always the first choice to me.

I am mainly with JS tech stack for years and play around Python from time to time - My set up in my machine is iterm2 + Oh-My-Zsh(theme) + plugins(e.g. autoJump & zsh Autosuggestions). I cant live without Autosuggestions in my terminal.

I use nix darwin, which can wrap homebrew for a gradual migration over.

Homebrew is ridiculously slow in my experience, and nix is quite easy when you stay on the happy path—and when you fall off of it homebrew is unlikely to help you anyway.

I've seen some people using asdf + direnv. Is there a vanilla way to go about it with asdf AND direnv sourced from brew, or is the mostly used route the asdf-direnv plugin [1]? Seems to be slightly unmaintained, few stars and last commit 9 months ago

[1] - https://github.com/asdf-community/asdf-direnv

I'm already accustomed to Homebrew and I don't think it's something that I have to fiddle with. It just works.

I use asdf for managing versions. Was using nvm, rbenv, etc previously.