This repository contains everything to bootstrap my Macbook Pro (16 inch, 2021). This setup has been heavily inspired by Michael Friedrich and his guide dotfiles - Document and automate your Macbook setup, and also this guide. The current ZSH theme is a custom theme built off the oh-my-zsh theme geoffgarside.
In addition to the files stored in this repository, the following instructions are needed to fully setup my Macbook Pro.
⚠️ ⚠️ ⚠️ Please be aware these scripts/MacOS settings/applications are all tailored for KrisM4c, so please check all options before applying to your own machine! :D I accept no responsibility for any issues that occur due to negligence of checking over the options being set! This repo can be used as a guideline for creating your own Dotfiles!
⚠️ ⚠️ ⚠️
As this repository has been sanitised, i have replaced items that will need replacing with you own information! You can use Find in Folder across the whole directory (INCLUDING THE <>), and replace with your info. Please see below for all of the variables to update throughout this repository to fit to your needs:
<FULL_NAME> (example: Kris M4c)
<COMPANY_EMAIL> (example: kris.m4c@example.com)
<COMPANY_NAME> (example: example-company)
<GITHUB_USERNAME> (example: KrisM4c)
<GITHUB_EMAIL> (example: krism4c@gmail.com)
<MAC_USERNAME> (example: krism4c)
<GITHUB_REPO_OWNER> (example: krism4c)
<ACCESS_KEY_ID> (example: AAAAAAA1234) - Used in `.aws/credentials`
<SECRET_ACCESS_KEY> (example: 123456789ABCDEFG) - Used in `.aws/credentials`
<NONPROD_GCP_PROJ> (example: gcp-nonprod-project) - Used in `.zshrc`
<PROD_GCP_PROJ> (example: gcp-prod-project) - Used in `.zshrc`
Install it manually from the website, start it and add it to the deck.
Initial settings:
- Import my profile from
./item2/profiles/KrisM4c.json. - Mark
KrisM4cprofile and selectOther Actions > Set as default.
Install it on the command line first, it will ask for permission.
xcode-select --installGenerate a token here with:
tokenName: dotfiles
expiration: 1 day
onlySelectedRepositories: `dotfiles`
permissions:
- group: Repository Permissions
name: Contents
access: Read-OnlySave the token as an env var:
export TOKEN=<TOKEN_HERE>To get the dotfiles synched and setup:
- Head to the dotfiles-setup script
- Click on the
Rawbutton - Copy the URL and run the following command
curl -fsSL <URL_HERE> | bashThis should setup the dotfiles correctly, and backup any existing files to ~/.dotfiles-backup/
To track new .dotfiles, you can run the following commands:
dotf add ~/some-folder/some-file
dotf status # (or dotfst)
dotf commit -m "add some-file" # (or dotfc "comment")
dotf push # (or dotfp)Using the script in .scripts/1-brew-setup, it will install brew silently, and then install all the required packaged in the Brewfile.
~/.scripts/1-brew-setupThis makes use of the Brewfile definitions.
mas is used to install apps from the app store, and is itself installed with Homebrew first in the Brewfile.
$ cat ~/.scripts/mac-setup-files/brew/Brewfile
brew "mas"
...
mas "1Password 7", id: 1333542190Note: I keep this disabled for improved security, though some sessions may require heavy sudo usage. This is actioned as part of the MacOS setup.
sudo vi /private/etc/sudoers.d/<MAC_USERNAME>
#<MAC_USERNAME> ALL=(ALL) NOPASSWD: ALLWith Bitwarden that has been downloaded, get the SSH keys and put them in ~/.ssh.
Setting up the MacOS preferences and OS settings, the following command can be ran:
~/.scripts/2-macos-setupThis will also setup the MacOS dock, so ensure that the Brew segment is completed first to allow this to work as expected.
These tools are managed outside of Homebrew, and require additional work and documentation.
NOTE: This is handled my the MacOS Setup script
Using mr, you can manage lots of github repos through single commands which makes mass updating a breeze. The config is handled by the .mrconfig file that sits in the parent directory of where you want your files to sit. The following will create and copy the mr configs to the correct locations:
~/.scripts/3-mr-setupThis creates directories according to what MyRepos configurations exist.
To update all work related repos:
upd-gitTo update all personal related repos:
upd-git-personalIf you require to update the list of what you require to pull, it can be found in ~/src/<PERSONAL||WORK>/.mrconfig. To ensure these are up to date on the repo, these are located in .scripts/mac-setup-files/mr
These are manual settings as they require user awareness.
Preferences > Sidebar and add
- Wireshark
More insights can be found in these lists:
On major version upgrades, binaries might be incompatible or need a local rebuild. You can enforce a reinstall by running the two commands below, the second command only reinstalls all application casks.
brew reinstall $(brew list)
brew reinstall $(brew list --cask)When Xcode and compilers break, re-install the command line tools.
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install