Skip to content

KrisM4c/general-dotfiles

Repository files navigation

Macbook Pro dotfiles and setup

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!

⚠️⚠️⚠️

Preparations

VARIABLES TO CHANGE

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`

iterm2

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 KrisM4c profile and select Other Actions > Set as default.

Git (XCode)

Install it on the command line first, it will ask for permission.

xcode-select --install

PAT Token

Generate a token here with:

tokenName: dotfiles
expiration: 1 day
onlySelectedRepositories: `dotfiles`
permissions:
  - group: Repository Permissions
    name: Contents
    access: Read-Only

Save the token as an env var:

export TOKEN=<TOKEN_HERE>

Mac Setup

Dotfiles Setup

To get the dotfiles synched and setup:

  1. Head to the dotfiles-setup script
  2. Click on the Raw button
  3. Copy the URL and run the following command
curl -fsSL <URL_HERE> | bash

This should setup the dotfiles correctly, and backup any existing files to ~/.dotfiles-backup/

Tracking new .dotfiles

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)

Brew

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-setup

This 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: 1333542190

Sudo

Note: 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: ALL

SSH Keys

With Bitwarden that has been downloaded, get the SSH keys and put them in ~/.ssh.

MacOS setup

Setting up the MacOS preferences and OS settings, the following command can be ran:

~/.scripts/2-macos-setup

This will also setup the MacOS dock, so ensure that the Brew segment is completed first to allow this to work as expected.

Essentials

These tools are managed outside of Homebrew, and require additional work and documentation.

Tools

myrepos

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-setup

This creates directories according to what MyRepos configurations exist.

To update all work related repos:

upd-git

To update all personal related repos:

upd-git-personal

If 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

Preferences

These are manual settings as they require user awareness.

Finder

Preferences > Sidebar and add

Homebrew

  • Wireshark

Additional Hints

More insights can be found in these lists:

Upgrades

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages