I have set up a new computer at least 15 times and each time it's been like I'm doing it from scratch. But I just got a new computer and it's high time to fix this problem. I'll show you how I made this process super easy.
Here are the goals for this project.
- Be able to do everything below by just running one command
- Have the script be re-runnable with no side effects
- Install Homebrew and associated apps
- Install Oh My Zsh
- Configure git
- Configure GitHub
- Configure Mac settings
- Install important scripts
If you just want to see the final result, check out the dotfiles repo.
Breaking the files up will allow for better organization and easier maintenance.
curl-entry.shwill be the entry point when calling via
curlwhich will enable it to be one command to get it going
install.shwill be the main script that will delegate to other scripts as needed
.zshrcwill contain my standard zsh config
Brewfilewill contain the list of apps to install with Homebrew
system-preferences.shwill contain all the Mac OSX settings I always set, like tap to click, locking desktop positions, etc.
.gitconfigwill contain my standard git config
Because there's a single entry point, it's super easy to run the script.
curl https://raw.githubusercontent.com/rgpass/dotfiles/main/curl-entry.sh | bash
Running the above command will do:
curlthe entry point file and pipe to
- Clone into a new directory and run the
sudoto only need to be entered once
- Make all the directories I normally make
z(frecent algorithm for jumping directories)
- Install Oh My Zsh
- Create symlink for
- Install or update Homebrew
- Install all the apps in the
- Configure the Mac settings
- Configure git and GitHub
- Exit all apps that would need to be restarted
After it's all done, the computer will be ready to go.
Brewfile's are super helpful and can be generated with
brew bundle dump. This creates a full dump, but you probably don't want all of them
- Also, you don't really need to keep dependencies versioned, so you can remove