Package management on macOS with Nix-Darwin
1–10 of 33 posts
Re: Package management on macOS with Nix-Darwin
#2Re: Package management on macOS with Nix-Darwin
#3Re: Package management on macOS with Nix-Darwin
#4This 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.
Re: Package management on macOS with Nix-Darwin
#5I’ve been running it for a couple years, you can use it to try Nix without as much up front learning.
Almost 1000 stars!
https://github.com/dustinlyons/nixos-config
Edit: Just crossed 1k! Thanks HN
Re: Package management on macOS with Nix-Darwin
#6That's pretty cool that it can install Homebrew packages. Can anyone speak to how well that actually works in practice?
Having nix-darwin uninstall brews not declared in the flake makes me stay honest about keeping my configuration up to date as well, if I've just `brew install x` to try something it'll get removed next time I apply my config. Needs adding to the flake to keep it installed persistently, which in turn means my config tends to be up to date.
Re: Package management on macOS with Nix-Darwin
#7That's pretty cool that it can install Homebrew packages. Can anyone speak to how well that actually works in practice?
My biggest annoyance is that Homebrew is really slow; the Homebrew part of my Nix-Darwin rebuilds usuay takes 3-5x as long as everything else combined. Homebrew is really slow even when it has nothing to do.
The only caveat worth mentioning is that the module built into Nix-Darwin doesn't support installing Homebrew itself. Instead you tell it the prefix for an existing Homebrew installation.
(There is an out-of-tree module for installing Homebrew as well, but I haven't tried it.)
Re: Package management on macOS with Nix-Darwin
#8I 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 recen…
Re: Package management on macOS with Nix-Darwin
#9It seems the clear barrier to entry to nix is UX and to an extent the custom language they use. Maybe this problem can be solved with LLMs. We need an LLM fine tuned to write nix language.
Re: Package management on macOS with Nix-Darwin
#10I 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 recen…
(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!