3 ms·
Brew is fine for what it is. Nix generally shines by being a way more general solution to the problem, which means you can take the nix managed version of thing
by JamesSwift 3y ago
Brew is fine for what it is. Nix generally shines by being a way more general solution to the problem, which means you can take the nix managed version of things and move them across machines/OSes very easily.
The main advantage of nix against brew purely as a mac package manager is the ability to easily use versions of things that aren't HEAD (or to use multiple different versions of things for different reasons). Homebrew has a really clunky way to do that, but its much more straightforward in nix.
- emptysongglass 3y agoI'd say brew is the least effective option but people on macOS just deal with it because it's basically the only package manager they've ever been exposed to. Lots of Stockholm Syndrome going around.
- hotnfresh 3y agoHeavy Linux user for about a decade before being given a MacBook at work and realizing how much time I’d been wasting for no reason (well, not no reason—I’m a lot more comfortable & capable on Linux servers than most other developers I’ve known). Have continued using Linux on servers, appliances, and checking in on how Desktop Linux is going every couple years, in the 13ish years since. I have a lot of experience with two major RPM-based ecosystems, with Portage, and with two major dpkg-based distos. I’ve also done a fair bit with Void, and a little bit with Arch and Nix. After switching to Mac, I used Macports for a little over a year before switching to Brew, IIRC. The factors I care about in a package manager, in no particular order: 1) How good’s the UI? 2) How often does it break or otherwise make some kind of bad thing happen when I use it? 3) How bad is my day going to be if it breaks or does a bad thing? 4) How good is the package selection? Brew is easily my favorite, based on that.
- NateEag 3y ago> 2) How often does it break or otherwise make some kind of bad thing happen when I use it? > 3) How bad is my day going to be if it breaks or does a bad thing? Gosh - I've used FreeBSD's package manager, Gentoo, MacPorts, apt-get, ad-hoc bash scripts, brew, nix, and even occasionally manual compilation for package management over the years, and brew is by far the one that's caused me the most pain. Just in the last year of $DAYJOB I've probably had brew break my dev environment at least three times because I installed a new tool and it auto-updated the others when I did that. Maybe I'm holding it wrong, but the others haven't done that to me. Obviously that's not your experience, and I don't intend to dismiss or demean that. It's just shocking to me how different our experiences of brew are. FWIW nix is definitely my favorite packager manager so far. I've been using NixOS on my laptop for about a year, and nix on macOS for package management before that, and it has been shockingly robust. I do not recall a single time a tool I got installed and working via nix has broken on me. Running a Linux desktop has been kind of disappointing in a lot of ways - while they've improved a lot in the last decade, there are tons of ways macOS and even Windows have superior overall UX. But for robust package management, nix has been everything I ever dreamed of and then some.
- hotnfresh 3y agoI think software systems need at least three kinds of software installation management (and “system” is key, because you need the operating system’s cooperation, or at least indifference, to make them all function right). 1) One to manage the OS software, 2) One to manage the packages the user or users run directly, and 3) One that can be sandboxed or otherwise isolated from the rest of the system, to some degree at least, for software project dependencies. Brew does not attempt to do #1 (that’s totally separate—which I now regard as the right way to do things, keeping the kernel et c. installer program and the Firefox et c. installer program separate is better) and is bad at #3, but so are most Linux package managers. Most of the time when I see people having trouble with Brew, they’re using it for #3 and it’s bad for that, so it’s not working well for them. It’s a type-2 package manager (but, again, most Linux package managers are also bad at that type-3 thing). I use asdf, direnv, and docker (for daemons—99% of my use of docker is as a sandboxing package manager) for my software project dependency management (type 3). Needing three things sucks, but each does a different thing, and it beats screwing around with per-software-ecosystem tools for things like virtual environments. I would also use them if I were back on Linux (most major distos, anyway—NixOS might be an exception) Nix, notably, is probably the only semi-popular package management system that could plausibly do a really good job at all of #1-3. I’d probably use it on Mac and Linux both if the package selection were as good as Brew (on Mac), and I didn’t hate their DSL. I think most popular(ish) Linux package managers other than Nix are worse type-2 package managers than Brew, and bad type-3 ones (as is Brew). I don’t just like Homebrew because I’ve not used plenty of other package management systems, though.
- NateEag 3y agoThanks for sharing this! It's a very insightful analysis and I think you're largely right.
- JamesSwift 3y agoIts basically the only package manager targeted by developers, so users follow suit. I think like 80% of brew users wouldnt be able to name a single alternative they could be using on mac instead.