Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blog] Setting up a new computer/laptop (macOS) #79

Open
0xdevalias opened this issue May 14, 2020 · 1 comment
Open

[Blog] Setting up a new computer/laptop (macOS) #79

0xdevalias opened this issue May 14, 2020 · 1 comment
Assignees
Labels
blog-idea An idea for a blog post and possibly related references/materials (use deep-dive if no blog planned)

Comments

@0xdevalias
Copy link
Owner

0xdevalias commented May 14, 2020

It would be cool to write about how I set up a new laptop, encoding some of my currently more manual processes, and the order that makes most sense in doing so.

Setting up a new laptop

Pre-Bootstrap

Go through the macOS installer, configure any settings as desired.

Once you've booted into macOS for the first time, it probably makes sense to check for any system updates (particularly major OS updates) and install those before continuing.

  • Open System Preferences, click Software Update, check for/install any updates

(Optional) At this stage, it may also be useful to get a snapshot of the default configurations on a freshly installed version of macOS. This can be useful for updating the scripts that configure macOS defaults (see 'dotfiles' section below)

  • Open Terminal and run defaults read > ~/Desktop/macOS-defaults.txt

Bootstrap

(Optional) Install command line development tools.

This will generally be performed as part of the Homebrew install script (see below), but if you want to do it manually, you can do this now (it's required for the default system installations of tools such as git, etc)

  • Open Terminal and then run xcode-select --install

If you try to run a command line tool such as git before installing this, you will see a message similar to the following:

xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

image

Install Homebrew

Homebrew is a package manager that makes it easy to install all of the other applications we want on our machine.

It can be easily installed by opening Terminal and running the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Once this is done, you probably also want enable the homebrew 'cask' 'tap', to be able to instal non CLI applications as well:

brew tap homebrew/cask

Dotfiles, defaults and core applications

Once I have my basic bootstrap tools installed, I can clone my dotfiles repo, and run some more automated setup scripts to get my environment exactly how I like it.

Open Terminal and clone my dotfiles repo. Note that we use https (rather than ssh) to clone for now, as we don't have ssh keys setup on our new machine yet:

git clone https://github.com/0xdevalias/dotfiles.git ~/.dotfiles

Make any customisations you may need before running. At a minimum, I would suggest checking that the latest versions are setup in:

  • TODO: ruby, python, node, etc?

Note: I hit a number of issues when running this that we should figure how to fix:

› /Users/devalias/.dotfiles/homebrew/install.sh
Already up-to-date.
› /Users/devalias/.dotfiles/antigen/install.sh
  › antigen update
Loading antigen..
  [ERROR] Antigen loader requires homebrew to be installed. Exiting.
› /Users/devalias/.dotfiles/zsh/install.sh
/Users/devalias/.dotfiles/zsh/install.sh: line 15: default-user-shell: command not found
/Users/devalias/.dotfiles/zsh/install.sh: line 16: default-user-shell: command not found
Setting default shell to zsh (homebrew) from ''
Changing shell for devalias.

After running the bootstrap, and restarting my terminal, it also seems as though it won't run all of the 'init scripts' correctly, due to missing programs, etc; which eventually cause the shell to exit with an error. These should either be included as part of a 'core required tools' step, or be smart enough to exit cleanly without running if those tools aren't already present:

Loading antigen..
  [ERROR] Antigen loader requires homebrew to be installed. Exiting.
/Users/devalias/.dotfiles/go/path.zsh:1: command not found: go
/Users/devalias/.dotfiles/ruby/path.zsh:9: command not found: rbenv
Loading gpg-agent..
[ERROR] Couldn't find 'gpg'. Try:
  brew install gpg

[brew-info]
  gnupg: stable 2.2.20 (bottled)
  GNU Pretty Good Privacy (PGP) package
  https://gnupg.org/
  Not installed
  From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/gnupg.rb
  ==> Dependencies
  Build: pkg-config
  Required: adns, gettext, gnutls, libassuan, libgcrypt, libgpg-error, libksba, libusb, npth, pinentry
  ==> Analytics
  install: 36,942 (30 days), 123,847 (90 days), 522,421 (365 days)
  install-on-request: 31,731 (30 days), 105,365 (90 days), 435,775 (365 days)
  build-error: 0 (30 days)
[ERROR] Couldn't find 'pinentry-mac'. Try:
  brew install pinentry-mac

[brew-info]
  pinentry-mac: stable 0.9.4 (bottled), HEAD
  Pinentry for GPG on Mac
  https://github.com/GPGTools/pinentry-mac
  Not installed
  From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/pinentry-mac.rb
  ==> Requirements
  Build: xcode
  ==> Options
  --HEAD
    Install HEAD version
  ==> Caveats
  You can now set this as your pinentry program like
  
  ~/.gnupg/gpg-agent.conf
      pinentry-program /usr/local/bin/pinentry-mac
  ==> Analytics
  install: 2,450 (30 days), 7,469 (90 days), 29,599 (365 days)
  install-on-request: 2,352 (30 days), 7,257 (90 days), 28,411 (365 days)
  build-error: 0 (30 days)
/Users/devalias/.dotfiles/gpg/gpg_agent.zsh:20: command not found: gpg2

  [ERROR] failed to parse gpg-config, not starting gpg-agent

[Process completed]
zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]?

If you see this, you can say n for the time being, then once your shell starts, run the following command to ensure the directories aren't world writeable:


Once everything is updated as desired, run script/bootstrap to install things:

cd ~/.dotfiles
script/bootstrap

At time of writing, this will:

  • configure name/email/etc for .gitconfig
  • link any *.symlink files from the dotfiles repo into $HOME
  • run bin/dot
    • sets up macOS defaults
    • ensures homebrew / mas are installed
      • TODO: add whalebrew and similar package management type things here too?
    • ensures antigen is installed
    • ensures zsh is installed
    • offers to run install scripts for various topics
    • offers to check for macOS updates

Note that the automatic running of installs scripts is a little manual/haphazard at the moment, mostly because I don't necessarily want to automatically install everything on a new machine. I would suggest checking the code to see what will be run, and sanity checking that each is going to do what you want it to. A lot of these scripts end up being run once per new machine, so they can drift/become outdated from my 'ideal setup' over time.

Eventually I would like to clean this up and standardise it a bit more, to be a 'bare minimal' set (eg. core development environments for node, python, ruby, etc. Though I think when that happens, it may make sense to do so as part of adopting a dotfiles management tool (see 0xdevalias/dotfiles#8)

For now, refer to the below sections for a more 'manual' list of core installs/setup tasks for a new dev machine. I've roughly attempted to document them in the order I would follow, but this isn't necessarily a hard requirement.

Computer Name

Basic text/code editor

  • Basic text/code editor: ~/.dotfiles/sublimetext/install.sh
    • TODO: move this into the above 'core' list of things?

Generate SSH key for GitHub, GitLab, Bitbucket, etc

  • Generate SSH key for GitHub, GitLab, Bitbucket, etc:
    • TODO: automate this as part of script/bootstrap
    • https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
    • ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/github_YOURUSERNAME_ed25519
      • Set a password on this key for extra security
    • Once you've created it, you need to add the public key to your GitHub account
    • TODO: add ssh config entry for GitHub
    • Now we want to add the key to ~/.dotfiles/ssh/keys.init so that ssh-keyinit works correctly
      • This file is just a list of the keys to be loaded with ssh-add
      • eg. github_USERNAME_ed25519 bitbucket_USERNAME_rsa gitlab_USERNAME_rsa
      • Once this is done, we can run ssh-keyinit once after restarting our machine, and it will load the specified keys for us
    • Once you have this SSH key setup, we can change our cloned dotfiles git repo to use SSH instead of HTTPS for it's remote

Terminal/Shell (iTerm2)

GPG (git commit signing, etc)

  • GPG (gpg, pinentry-mac):
    • ~/.dotfiles/gpg/install.sh
    • TODO: move this into the above 'core' list of things?

Keybase

  • Keybase: brew cask install keybase
    • Login to Keybase and verify it with one of your previously linked devices
    • TODO: anything needed to setup CLI tools, file system, gpg keys, etc?
      • keybase pgp list
      • keybase pgp pull-private THEGPGKEYID (repeat for other keys as required)
        • Once this is done, you may want to update your signingkey in ~/.dotfiles/git/gitconfig.local.symlink
          • gpg --list-secret-keys --keyid-format LONG
          • git config --file ~/.gitconfig.local --set user.signingkey THE16CHARKEYID
          • TODO: this should be automated as part of git config setup in script/bootstrap or similar
  • Note: Some of this is closely related to/relies on GPG being setup first

Development Tools (Java, Node, Python, Ruby, Golang, Swift, Xcode, etc)

  • Dev environment managers:
    • Java (jenv, etc): ~/.dotfiles/java/install.sh
    • Node (nodenv, etc): ~/.dotfiles/node/install.sh
    • Python (pyenv): ~/.dotfiles/python/install.sh
    • Ruby (rbenv): ~/.dotfiles/ruby/install.sh
    • TODO: Golang (goenv)?
    • TODO: Swift (swiftenv)?
  • JetBrains Toolbox (Webstorm, IntelliJ, etc): brew cask install jetbrains-toolbox
  • Xcode: ~/.dotfiles/xcode/install.sh (TODO: update this?)
  • SourceTree: brew cask install sourcetree (similar to gitkraken but free)
    • Open Terminal and create a new symlink to /usr/local/bin/gpg called gpg2
      • ln -s /usr/local/bin/gpg /usr/local/bin/gpg2
    • Preferences -> Advanced -> GPG Program
      • Set this to /usr/local/bin (it looks for a binary called gpg2 in this folder)
    • For each repository, in Repository -> Repository Settings -> Security
      • check "Enable GPG signing for commits" and select the appropriate key ID
      • if this option is disabled, you probably need to symlink the gpg2 binary as described above
  • GitKraken: brew cask install gitkraken (similar to SourceTree)
  • Etc
    • brew cask install aws-vault
    • brew cask install docker
    • brew cask install postman
    • brew cask install insomnia (optional, similar to postman)

Web Browser

  • Web Browser: brew cask install google-chrome
    • (Optional) brew cask install chrome-remote-desktop-host
    • Open Google Chrome, sign in to your google account and enable sync
      • Depending on the size of your profile, this could take a few minutes to sync and pull all of your bookmarks, extensions, etc across
    • It seems some extensions won't sync their preferences properly, so you may have to manually export/sync/re-configure them
      • LastPass
        • For some reason this extension didn't automatically install itself, so I had to re-add it manually
        • You just need to log into your account for settings/sync
      • Proxy SwitchyOmega (can import/export)
  • TODO: move this higher on the list of priorities?

Alfred

  • brew cask install alfred
    • Follow instructions in the setup wizard to add powerpack licence key, restore backed up settings, etc
    • Settings -> Advanced -> Syncing -> Set preferences folder
      • Depending how you sync your preferences (eg. Dropbox), you may need other apps installed before you can properly configure this
    • See also:
    • https://appsliced.co/ask/how-do-i-change-the-keyboard-shortcut-for-spotlight-in-os-x
      • System Preferences -> Spotlight -> Keyboard shortcuts
        • Disable Show spotlight search
    • Then configure desired shortcut (eg. command+space) in Alfred's settings
      • Settings -> General -> Alfred Hotkey
  • There are some settings that don't appear to be backed up/synced, we can configure these manually
    • Settings -> Features -> Web Bookmarks
      • check "Google Chrome Bookmarks"
    • Settings -> Features -> Clipboard History
      • check "Keep Plain Text" and select "24 hours"

BetterTouchTool

  • brew cask install bettertouchtool
    • Settings can be backed up/restored manually, or with a highly experimental 'sync' mode
      • In my experience, the sync seems less than ideal, and may cause CPU to spin, so manual seems the better option for now
      • From the main app screen, top right corner, select the Preset dropdown
        • From here you can use the Export Highlighted or Import buttons
        • Import from where you saved your settings (eg. Dropbox -> Backup -> BetterTouchTool)
        • (optional) At this stage you may want to
          • set the newly imported preset as the Master Preset
          • delete the existing Default preset
          • rename your imported preset with this computer's name (eg. Default (THISCOMPUTER))
    • You may want to also customise some of the settings in the settings menu itself
      • Settings -> Standard Settings -> Basic -> Launch BetterTouchTool on Startup
      • `Settings -> Standard Settings -> Basic -> Allow crash log and anonymised usage data
      • Settings -> Advanced Settings -> General -> Enable automatic update checking
      • Settings -> Advanced Settings -> General -> Install Process Priority Helper Tool
      • Settings -> Advanced Settings -> Scripting BTT -> Allow External BetterTouchTool Scripting
        • If you enable this, make sure to set the shared secret as well
      • Settings -> Advanced Settings -> Sync
        • Good to know this exists, but at the moment it doesn't seem particularly stable/useful, so maybe leave it disabled and backup/sync manually

Bartender

  • brew cask install bartender

Hyperdock

  • brew cask install hyperdock

Unsorted

The following don't have any complex setup scripts/environment required, so we can just manually install them with HomeBrew if desired:

  • brew cask install XXX
    • Core system tools
      • disk-inventory-x
      • flux
      • gemini (duplicate file finder)
    • Security/etc
      • viscosity
      • lastpass
    • Download
      • dropbox
      • resilio-sync
    • Organisation
      • fantastical
        • Make sure to add your Fantastical 2 licence (if you have one) to unlock all of the old features without requiring a monthly subscription
        • Preferences -> Accounts
          • Make sure to sign in to all your accounts (Flexibits, iCloud, Google, Todoist, Meetup, etc)
        • Preferences -> Accounts -> Open maps in -> Google Maps
        • etc
        • [fantastical] Automatically export/configure defaults/settings dotfiles#14
      • toggl
    • Communication
      • discord
      • signal
      • skype
      • telegram
      • zoomus
    • TODO: Facebook Messenger, WhatsApp, etc?
    • Audio/Video
      • lastfm (optional)
      • plexamp
      • spotify
      • vlc
    • Audio Production
      • blackhole
      • native-access
      • soundflower
      • We can't install these with homebrew, so grab them manually
    • Games
      • sidequest
      • sony-ps4-remote-play
      • steam
  • brew install XXX (a small selection, see brew.*.list files for more)
    • aria2
    • awscli
    • coreutils
    • dive
    • exiftool
    • ffmpeg
    • git
    • gnupg
    • go
    • gobuster
    • goreleaser
    • hub
    • jq
    • pcre
    • qemu
    • unrar
    • watchman

Unsorted

App Store

We also want to open the App Store, and install any past purchases we want on this machine:

  • Open App Store
  • Login with your Apple ID if you haven't already
  • Click on your account name in the bottom left-hand corner
  • The Account page should list any past purchases under the Purchased heading
    • Click the download icon for any you want to install
  • If you want to install Xcode, search for the latest version, and click install

Launchpad

Next we want to organise applications in Launchpad into appropriate folders. While this is controlled by a sqlite database, I'm not currently aware of any tools that allow us to do this automatically, so we'll do it manually for now:

  • TODO: list folder names I tend to use, in order they would be (top left, moving right/down)

Cleaning up an old laptop before selling/disposing

Unsorted

Legacy

@0xdevalias 0xdevalias added the blog-idea An idea for a blog post and possibly related references/materials (use deep-dive if no blog planned) label May 14, 2020
@0xdevalias 0xdevalias self-assigned this May 14, 2020
@0xdevalias 0xdevalias pinned this issue Jun 29, 2022
@0xdevalias
Copy link
Owner Author

0xdevalias commented Apr 11, 2023

Setup steps - MacBook Pro 16" (2023) M2 Max (April 2023)

macOS Ventura 13.2.1

Pre-Bootstrap

macOS Installer

Go through the macOS installer, configure any settings as desired:

  • Language: English (Australia)
  • Country or Region: Australia
  • Accessibility
    • Vision
      • VoiceOver: No
      • Zoom: No
      • Hover Text: No
      • Speak Selection: No
      • Pointer Size: Standard
      • Reduce Transparency: Standard
      • Increase Contrast: Standard
      • Appearance: Dark
      • Reduce Motion: Standard
    • Motor
      • Accessibility Keyboard: No
    • Hearing
      • Closed Captions: No
      • Flash for alerts: No
    • Cognitive
      • Appearance: Dark
      • Speak Selection: No
      • Typing Feedback: No
      • Hover Text: No
  • Select Your Wi-Fi Network
  • Data & Privacy
  • Migration Assistant
    • Not Now
  • Sign in with Your Apple ID
  • Create a Computer Account
  • Make This Your New Mac
    • Location Services
    • Device Analytics
    • App Analytivs
    • Siri
    • Screen Time
    • Appearance
  • FileVault Disk Encryption
  • Touch ID
  • Apple Pay

Install System / OS Updates

Once you've booted into macOS for the first time, it probably makes sense to check for any system updates (particularly major OS updates) and install those before continuing.

  • Open System Preferences, click Software Update, check for/install any updates

(Optional) Save snapshot of macOS default config

At this stage, it may also be useful to get a snapshot of the default configurations on a freshly installed version of macOS. This can be useful for updating the scripts that configure macOS defaults (see 'dotfiles' section below)

Open Terminal and run the following:

mkdir ~/Desktop/macOS-defaults/
mkdir ~/Desktop/macOS-defaults/domains

defaults read > ~/Desktop/macOS-defaults/defaults-read.txt
defaults domains > ~/Desktop/macOS-defaults/defaults-domains.txt
defaults export -globalDomain - > ~/Desktop/macOS-defaults/defaults-export-globalDomain.xml

Then to export each individual domain's settings as .xml files, we can use the following script:

#!/bin/bash

# ChatGPT Ref: https://chat.openai.com/chat/c03c1acf-5ba2-46a1-878e-020bb4715df6

# Define the output directory
output_dir="$HOME/Desktop/macOS-defaults/domains"

# Get a list of all domains
domains=$(defaults domains)

echo "Exporting domains..."

# Loop through each domain
IFS=", "
for domain in $domains; do
  # Export the domain to an XML file
  echo "  $domain"
  defaults export "$domain" - > "${output_dir}/${domain}.xml"
done

Bootstrap

(Optional) Install command line development tools.

This will generally be performed as part of the Homebrew install script (see below), but if you want to do it manually, you can do this now (it's required for the default system installations of tools such as git, etc)

  • Open Terminal and then run xcode-select --install

If you try to run a command line tool such as git before installing this, you will see a message similar to the following:

xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

image

Install Homebrew

Homebrew is a package manager that makes it easy to install all of the other applications we want on our machine.

It can be easily installed by opening Terminal and running the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

We used to have to manually set up the homebrew/cask tap separately, but this is automatically included and enabled by default these days.

(Optional) Universal Control

If you're setting up your new system while you still have your old one running, you can make use of macOS' Universal Control feature to share the same mouse/keyboard between both devices:

You can enable this by:

  • Open System Settings -> Displays -> Advanced
  • Enable Allow your pointer and keyboard to move between any nearby Mac or iPad

To make things easier, you probably also want to arrange your devices similar to how they are actually positioned in real life:

  • Open System Settings -> Displays -> Arrange
  • Position your screens/devices in a way that mirrors their physical layout

Once this is configured (potentially on both devices), you should be able to 'push' your pointer 'through' the edge of the screen from one device to the other.

Dotfiles, defaults, and core applications

Clone 0xdevalias/dotfiles

Once I have my basic bootstrap tools installed, I can clone my dotfiles repo, and run some more automated setup scripts to get my environment exactly how I like it.

Open Terminal and clone my dotfiles repo. Note that we use https (rather than ssh) to clone for now, as we don't have ssh keys setup on our new machine yet:

git clone https://github.com/0xdevalias/dotfiles.git ~/.dotfiles

Bootstrap dotfiles (~/.dotfiles/scripts/bootstrap)

Within Terminal, run the dotfiles bootstrap script to configure git and symlink all of the dotfiles configuration into place:

~/.dotfiles/script/bootstrap
Example output
% ~/.dotfiles/script/bootstrap 

  [ .. ] setup gitconfig.local
  [ ?? ]  - What is your github author name?
Glenn 'devalias' Grant
  [ ?? ]  - What is your github author email?
[email protected]

TODO: Setup commit signing automagically https://github.com/pstadler/keybase-gpg-github
TODO: Setup commit signing https://github.com/pstadler/keybase-gpg-github

  [ OK ] gitconfig
  [ .. ] installing dotfiles
  [ OK ] linked /Users/devalias/.dotfiles/vim/vimrc.symlink to /Users/devalias/.vimrc
  [ OK ] linked /Users/devalias/.dotfiles/asdf/asdfrc.symlink to /Users/devalias/.asdfrc
  [ OK ] linked /Users/devalias/.dotfiles/asdf/tool-versions.symlink to /Users/devalias/.tool-versions
  [ OK ] linked /Users/devalias/.dotfiles/go/cobra.yaml.symlink to /Users/devalias/.cobra.yaml
  [ OK ] linked /Users/devalias/.dotfiles/gpg/gnupg.symlink to /Users/devalias/.gnupg
  [ OK ] linked /Users/devalias/.dotfiles/config.symlink to /Users/devalias/.config
  [ OK ] linked /Users/devalias/.dotfiles/ssh/ssh.symlink to /Users/devalias/.ssh
  [ OK ] linked /Users/devalias/.dotfiles/iterm2/iterm2.symlink to /Users/devalias/.iterm2
  [ OK ] linked /Users/devalias/.dotfiles/iterm2/iterm2_shell_integration.zsh.symlink to /Users/devalias/.iterm2_shell_integration.zsh
  [ OK ] linked /Users/devalias/.dotfiles/localrc.example.symlink to /Users/devalias/.localrc.example
  [ OK ] linked /Users/devalias/.dotfiles/zsh/zshrc.symlink to /Users/devalias/.zshrc
  [ OK ] linked /Users/devalias/.dotfiles/atom.symlink to /Users/devalias/.atom
  [ OK ] linked /Users/devalias/.dotfiles/ruby/gemrc.symlink to /Users/devalias/.gemrc
  [ OK ] linked /Users/devalias/.dotfiles/ruby/pryrc.symlink to /Users/devalias/.pryrc
  [ OK ] linked /Users/devalias/.dotfiles/ruby/irbrc.symlink to /Users/devalias/.irbrc
  [ OK ] linked /Users/devalias/.dotfiles/git/gitconfig.symlink to /Users/devalias/.gitconfig
  [ OK ] linked /Users/devalias/.dotfiles/git/gitconfig.local.symlink to /Users/devalias/.gitconfig.local
  [ OK ] linked /Users/devalias/.dotfiles/git/gitignore_global.symlink to /Users/devalias/.gitignore_global
  [ OK ] linked /Users/devalias/.dotfiles/starship.symlink to /Users/devalias/.starship

  All installed!
TODO: Computer Name

TODO: This should probably get moved into the bootstrap script so it happens automagically

TODO: Generate SSH key for GitHub, GitLab, Bitbucket, etc

TODO: This should probably get moved into the bootstrap script so it happens automagically

TODO: We should leverage the GitHub CLI (gh) tool as much as possible here

  • Generate SSH key for GitHub, GitLab, Bitbucket, etc:
    • TODO: automate this as part of script/bootstrap
    • https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
    • ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/github_YOURUSERNAME_ed25519
      • Set a password on this key for extra security
    • Once you've created it, you need to add the public key to your GitHub account
    • TODO: add ssh config entry for GitHub
    • Now we want to add the key to ~/.dotfiles/ssh/keys.init so that ssh-keyinit works correctly
      • This file is just a list of the keys to be loaded with ssh-add
      • eg. github_USERNAME_ed25519 bitbucket_USERNAME_rsa gitlab_USERNAME_rsa
      • Once this is done, we can run ssh-keyinit once after restarting our machine, and it will load the specified keys for us
    • Once you have this SSH key setup, we can change our cloned dotfiles git repo to use SSH instead of HTTPS for it's remote
TODO: GPG (git commit signing, etc)

TODO: This should probably get moved into the bootstrap script so it happens automagically, since it's sort of a requirement for fully configuring git + commit signing properly

  • GPG (gpg, pinentry-mac):
    • ~/.dotfiles/gpg/install.sh
    • TODO: move this into the above 'core' list of things?
TODO: Keybase

TODO: This should probably get moved into the bootstrap script so it happens automagically, since it's sort of a semi-requirement for fully configuring git + commit signing properly I think

  • Keybase: brew cask install keybase
    • Login to Keybase and verify it with one of your previously linked devices
    • TODO: anything needed to setup CLI tools, file system, gpg keys, etc?
      • keybase pgp list
      • keybase pgp pull-private THEGPGKEYID (repeat for other keys as required)
        • Once this is done, you may want to update your signingkey in ~/.dotfiles/git/gitconfig.local.symlink
          • gpg --list-secret-keys --keyid-format LONG
          • git config --file ~/.gitconfig.local --set user.signingkey THE16CHARKEYID
          • TODO: this should be automated as part of git config setup in script/bootstrap or similar
  • Note: Some of this is closely related to/relies on GPG being setup first

At this point it's worth closing and re-opening Terminal so that the configuration from the dotfiles can take effect.

TODO: Can we reload the shell automagically so we don't have to do it manually here..?

When the Terminal restarts, you might see some errors like the following, these are ok to ignore for now:

Loading antigen..
Error: No such keg: /opt/homebrew/Cellar/antigen
  ERROR: Antigen not found. Was it installed with homebrew? Skipping. (/opt/homebrew/share/antigen/antigen.zsh, )

Shell prompt customisations (~/.dotfiles/starship.symlink/install.sh)

Our terminal isn't quite looking right yet as we're missing Starship, which manages our shell prompt customisations. We can install that now as follows:

~/.dotfiles/starship.symlink/install.sh 
Example output
~/.dotfiles/starship.symlink/install.sh                        
[starship::install]
[require_installed_brew::starship]
  Required command 'starship' missing. Installing..
==> Fetching starship
==> Downloading https://ghcr.io/v2/homebrew/core/starship/manifests/1.13.1
==> Downloading https://ghcr.io/v2/homebrew/core/starship/blobs/sha256:9d12ac9dcb05ca2ea86b943be41eaa32c2850ae429b6fc576c280f1e78514613
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:9d12ac9dcb05ca2ea86b943be41eaa32c2850ae429b6fc576c280f1e78514613?se=2023-04-11T07%3A45%3A00Z&sig=Zek7y3tfm5IZ9G0Aqdq6mJVCKzfkpJk2JeZ0ha43Geg%3D&sp=r&spr=https&sr=b&sv=2019-12-12
==> Pouring starship--1.13.1.arm64_ventura.bottle.tar.gz
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Summary
🍺  /opt/homebrew/Cellar/starship/1.13.1: 11 files, 5.7MB
==> Running `brew cleanup starship`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
  Install log: /tmp/brew-install-starship.log

Once Starship is installed, close and re-open Terminal again, and now things should look more normal:

image

Basic text/code editor (~/.dotfiles/sublimetext/install.sh)

Some of the next steps will be easier with a basic code/text editor installed, so we'll install Sublime Text next:

~/.dotfiles/sublimetext/install.sh
Example output
~/.dotfiles/sublimetext/install.sh
[sublimetext::install]
[require_installed_brew_cask::sublime-text]
  Required cask 'sublime-text' missing. Installing..
==> Downloading https://download.sublimetext.com/sublime_text_build_4143_mac.zip
==> Installing Cask sublime-text
==> Moving App 'Sublime Text.app' to '/Applications/Sublime Text.app'
==> Linking Binary 'subl' to '/opt/homebrew/bin/subl'
🍺  sublime-text was successfully installed!
  Install log: /tmp/brew-cask-install-sublime-text.log
[sublimetext] Making settings folder.. (/Users/devalias/Library/Application Support/Sublime Text/Packages/User)
[sublimetext] User settings found, moving into dotfiles.. (/Users/devalias/.dotfiles/sublimetext/SublimeSettings)
[sublimetext] Symlinking settings path to dotfiles.. (/Users/devalias/Library/Application Support/Sublime Text/Packages/User)

TODO: Install Node, Python, Ruby, etc

Make any customisations you may need before running. At a minimum, I would suggest checking that the latest versions are setup in:

  • TODO: ruby, python, node, etc?

TODO: continue things here

Misc

  • Configure macOS sidebar widgets

TODO

Continue setting up new laptop as per the main config steps detailed above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blog-idea An idea for a blog post and possibly related references/materials (use deep-dive if no blog planned)
Projects
None yet
Development

No branches or pull requests

1 participant