When you search for "dotfiles" on GitHub, you'll find plenty of good script examples for setting up a new computer. Since Apple doesn't provide good documentation on what you can configure with "defaults" variables, these examples are a goldmine.
I moved all my setup to Ansible about five years ago. It’s been awesome, especially as it makes it trivial to replicate changes to new machines. Installed a new package? Run the playbook again. Changed a script? Run the playbook again.
Sure, there are edge cases I hit because I have some older machines, but for the most part, it’s awesome. I’m up and running on new Macs within a coffee break of getting terminal access.
This is the ideal version of the playbook I've been wanting to write for years to automate the chaotic dotfile collection I've written over the last 15 years!
I have https://github.com/rcarmo/ground-init - which I also use for Macs, although via a bit of a hack right now. I should update it to a brewfile-like setup...
Anyway, my $0.02 is that doing fully automated installs on Macs is a fast track to having weird Finder and settings bugs (if not worse), so I mostly just install packages and very seldom (if ever) apply settings via the CLI -- I've had Apple break things across too many OS releases to find that a worthwhile long-term strategy, and most of the time I'd rather just use Migration Assistant (across Macs with equivalent OS versions) or configure settings manually for a new OS release.
Edit: just went and updated the above script to support brew/cask installs on macOS. Settings can go into the runcmd section.
I'm trying nix instead of Homebrew on my mac. It worked great until I decided to give rust a shot. I think my solution is to just do rust development on my Arch machine and stick with nix. That said, if I run into additional issues, I will probably just go back to Homebrew.
I used to hand-setup each new Mac, but lately (last decade or so; gosh this M1 Pro is absolutely ancient) I just let the migration assistant do the needful.
Storage is too cheap for me to spend time optimizing it anymore. I’m sure I have cruft somewhere, but it doesn’t bother me.
It leaves the "source computer" alone, so if it blows up you can always just start again.
I never trade in my old computer, even if I'm going to sell or get rid of it (donate) I keep it around for a month or so to make sure everything's working.
I get that. Personally, I'm a bit weird because I don't like to bring all the stuff from the previous machine (documents, files, etc.). I like to start fresh and only install a couple of apps / configure some settings.
https://github.com/geerlingguy/mac-dev-playbook
Sure, there are edge cases I hit because I have some older machines, but for the most part, it’s awesome. I’m up and running on new Macs within a coffee break of getting terminal access.
Deleted Comment
Anyway, my $0.02 is that doing fully automated installs on Macs is a fast track to having weird Finder and settings bugs (if not worse), so I mostly just install packages and very seldom (if ever) apply settings via the CLI -- I've had Apple break things across too many OS releases to find that a worthwhile long-term strategy, and most of the time I'd rather just use Migration Assistant (across Macs with equivalent OS versions) or configure settings manually for a new OS release.
Edit: just went and updated the above script to support brew/cask installs on macOS. Settings can go into the runcmd section.
I’ll probably use something dumber for the next machine, and keep nix for servers and local vms.
Where were your pain points?
Deleted Comment
P.S. I don’t use home manager though as I also need to bootstrap systems without nix.
I have a file that sets my MacOS Defaults: https://github.com/joeyagreco/dotfiles/blob/main/.macos
And a file to remap some keys: https://github.com/joeyagreco/dotfiles/blob/main/.macos_key_...
And apply the remaps: https://github.com/joeyagreco/dotfiles/blob/b5b819c9bcde2e3a...
Storage is too cheap for me to spend time optimizing it anymore. I’m sure I have cruft somewhere, but it doesn’t bother me.
but will it revert back if things go wrong?
I never trade in my old computer, even if I'm going to sell or get rid of it (donate) I keep it around for a month or so to make sure everything's working.