top | item 40158908

(no title)

IfOnlyYouKnew | 1 year ago

I have all the love and appreciation in the world for enjoying a weekend spent in configuration files. But I feel the need to state the obvious:

This is a long blog post ending with a preview to "future installments of the guide" to use nix, while almost everything that you need to know with homebrew is `brew install/update/upgrade/uninstall`, and I have rarely run into any trouble with brew, and none at all in recent memory.

discuss

order

drampelt|1 year ago

My biggest issues with homebrew were dealing with versions of dependencies. If major updates for a package came out and you ran a `brew upgrade` (or a new member joins the team and installs it for the first time), it often wasn't trivial to switch back to the old version. Or if two projects have conflicting dependencies, for example one project was updated for imagemagick 7 but another still needed 6, that was an absolute nightmare to manage when using homebrew.

With nix, each project can define its own dependencies that have no impact on other projects. Combined with direnv, all you need is to `cd` into your project and you have the all of the dependencies at the right versions in your PATH.

Additionally, while definitely more complicated, nix (with nix-darwin and home-manager) can do way more than homebrew does. You can declaratively define pretty much the entire configuration for your machine.

I got a new Mac last week and with just a `git clone` and a few commands I had all my CLI tools installed, dotfiles setup, desktop apps installed, and even all of my macOS system settings configured.

OJFord|1 year ago

I'm recently back on macOS for work, and I wanted to love nix-darwin, but just couldn't get it even installed / basics running well enough to start to enjoy configuring things with it. The whole flakes mess really doesn't help.

(Maybe if you're already running NixOS and familiar with the latest it's a lot easier.)

I couldn't even uninstall it cleanly, since the Mac was new I gave up after some time and decided it was easier to reinstall macOS (which takes several hours but at least I can just leave it and then know that it's done).

So I'm back to (purely) brew (and scripts to `defaults write` etc.).

My frustration with brew is that it's getting increasingly opinionated, and those opinions are not familiar to me from any other OS/package manager... Like if you want postgres v15 you have to `brew install postgresql@15`, and then even if that's your only installed version it's 'keg-only', which means it's not on your PATH, and their suggestion is to dump some stuff at the end of your ~/.zshrc, which aside from the fact you're not using zsh and they could tell that, just seems dumb.

Then there's python & npm packages... They're deprecated and being removed as independent formulae, so don't do it like that. You're not allowed to install them with the python/node formula you installed, so don't do that. So what do you do, `python -m venv ~/system-python-venv` or something, activate it, and install in there. And now remember to activate that every time you want to use a command that happens to be a python package so you had to install it there. Or dump it in the end of your zshrc, I guess!

pxc|1 year ago

The hardest part of Nix module systems for foreign operating systems, like Nix-Darwin and Home Manager, is absolutely installing them. The difficult bits are the bits they don't control— the parts where they plug into the underlying OS.

If you wanna give Nix-Darwin another go, I'm happy to help. Feel free to hit me up in the main Nix / NixOS channel or the Nix on macOS channel on Matrix. Getting everything working shouldn't take long with a little guidance.

(I can also help you get it cleanly uninstalled without reinstalling macOS, if you come away unsatisfied. I have manually uninstalled (i.e., not using the uninstaller) before.)

wenc|1 year ago

I have used brew trouble free for many years.