3 ms·
> It's strange that people are so against declarative systems, or even file-based OS configuration. When I get my new Macbook I was up-and-running within a few
by drbaba 3y ago
> It's strange that people are so against declarative systems, or even file-based OS configuration. When I get my new Macbook I was up-and-running within a few minutes. I can't imagine maintaining a list of brews I need to re-install just to set up everything + my configs + everything else.
I haven’t had time to try Nix yet, but HomeBrew does have a declarative-ish workflow that I’ve been using for years:
Brew Bundle [1] lets you have a plaintext file listing all packages you want installed on your system. Add a line for stuff you want installed, delete a line for stuff you want removed, invoke it the right way and it will install/remove packages until your system matches the list. The initial list can be generated by “brew bundle dump” or something like that.
For configuration, I find that a normal dotfile repo cloned into my ~/.config (with a script that maintains symlinks to config files in e.g. ~/Library) works well enough for my use.
[1]: https://github.com/Homebrew/homebrew-bundle https://github.com/Homebrew/homebrew-bundle
- pxc 3y agoThis is actually the mechanism behind Nix-Darwin's Homebrew support. In Nix terms, it uses the module system to generate a Brewfile, and then it invokes the brew CLI against that file in the activation script. Nix or no Nix, it's definitely a better way to use Homebrew than ad-hoc, imo!