[Blog] Setting up a new computer/laptop (macOS)
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.![]()
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:
compaudit | xargs chmod g-w- https://stackoverflow.com/questions/13762280/zsh-compinit-insecure-directories
- https://www.wezm.net/technical/2008/09/zsh-cygwin-and-insecure-directories/
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
*.symlinkfiles from the dotfiles repo into$HOME - run
bin/dot
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 https://github.com/0xdevalias/dotfiles/issues/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
- Choose a name for this computer, configure it
- System Preferences -> Sharing -> Computer Name
- TODO: can we set this from command line as well?
- https://apple.stackexchange.com/questions/66611/how-to-change-computer-name-so-terminal-displays-it-in-mac-os-x-mountain-lion
sudo scutil --set ComputerName "newname"(required)sudo scutil --set LocalHostName "newname"(required)sudo scutil --set HostName "newname"(probably not needed)- Flush the DNS cache:
dscacheutil -flushcache(required?) - Restart computer (required?)
- Can also check current settings with
scutil --get ComputerName(was updated when I change computer name in system preferences)scutil --get LocalHostName(was updated when I change computer name in system preferences)scutil --get HostName("HostName: not set", even after configuring computer name in system preferences (but haven't restarted yet))
- https://knowledge.autodesk.com/search-result/caas/sfdcarticles/sfdcarticles/Setting-the-Mac-hostname-or-computer-name-from-the-terminal.html
- https://apple.stackexchange.com/questions/66611/how-to-change-computer-name-so-terminal-displays-it-in-mac-os-x-mountain-lion
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
cat ~/.ssh/github_devalias_ed25519.pub | pbcopy(this will copy it to the clipboard)- https://github.com/settings/keys
- Click "New SSH Key"
- Title:
[email protected] - Key: paste the key you copied above
- Click "Add SSH Key"
- TODO: add ssh config entry for GitHub
- Now we want to add the key to
~/.dotfiles/ssh/keys.initso thatssh-keyinitworks 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-keyinitonce after restarting our machine, and it will load the specified keys for us
- This file is just a list of the keys to be loaded with
- 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
cd ~/.dotfilesgit remote set-url origin [email protected]:0xdevalias/dotfiles.git
- TODO: automate this as part of
Terminal/Shell (iTerm2)
- Terminal/Shell (iTerm2):
~/.dotfiles/iterm2/install.sh- see also: https://github.com/0xdevalias/dotfiles/issues/9
- Manual configuration steps
- iTerm2 Menu > Make iTerm2 Default Term
- iTerm2 Menu > Install Shell Integration
- Also check "Also install iTerm2 Utilities"
- "Download and Run Installer"
- more details
- https://www.iterm2.com/documentation-shell-integration.html
- https://www.iterm2.com/documentation-utilities.html
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 listkeybase pgp pull-private THEGPGKEYID(repeat for other keys as required)- Once this is done, you may want to update your
signingkeyin~/.dotfiles/git/gitconfig.local.symlinkgpg --list-secret-keys --keyid-format LONGgit config --file ~/.gitconfig.local --set user.signingkey THE16CHARKEYID- TODO: this should be automated as part of git config setup in
script/bootstrapor similar
- Once this is done, you may want to update your
- 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)?
- Java (
- JetBrains Toolbox (Webstorm, IntelliJ, etc):
brew cask install jetbrains-toolbox - Xcode:
~/.dotfiles/xcode/install.sh(TODO: update this?) - SourceTree:
brew cask install sourcetree(similar togitkrakenbut free)- Open Terminal and create a new symlink to
/usr/local/bin/gpgcalledgpg2ln -s /usr/local/bin/gpg /usr/local/bin/gpg2
Preferences -> Advanced -> GPG Program- Set this to
/usr/local/bin(it looks for a binary calledgpg2in this folder)
- Set this to
- 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
gpg2binary as described above
- Open Terminal and create a new symlink to
- GitKraken:
brew cask install gitkraken(similar to SourceTree) - Etc
brew cask install aws-vaultbrew cask install dockerbrew cask install postmanbrew 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)
- LastPass
- (Optional)
- 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://www.alfredapp.com/help/troubleshooting/reset-alfred/
defaults read com.runningwithcrayons.Alfreddefaults read com.runningwithcrayons.Alfred-preferences
- 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
- System Preferences -> Spotlight -> Keyboard shortcuts
- 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 checkingSettings -> Advanced Settings -> General -> Install Process Priority Helper ToolSettings -> 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
- Settings can be backed up/restored manually, or with a highly experimental 'sync' mode
Bartender
brew cask install bartender
Hyperdock
brew cask install hyperdock
Unsorted
- TODO: sort order of these (or cleanup if already mentioned elsewhere)
- lastpass, etc
- ssh keys for GitHub, GitLab, Bitbucket, etc
- ssh config
- generate/restore git commit signing keys
- TODO: review lists in https://github.com/0xdevalias/dotfiles/tree/devalias/homebrew/lists/nyxaevum.local
- TODO: create 'main' folder structures in home environment (dev, etc)
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-xfluxgemini(duplicate file finder)
- Security/etc
viscositylastpass
- Download
dropboxresilio-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
- https://github.com/0xdevalias/dotfiles/issues/14
toggl
- Communication
discordsignalskypetelegramzoomus
- TODO: Facebook Messenger, WhatsApp, etc?
- Audio/Video
lastfm(optional)plexampspotifyvlc
- Audio Production
blackholenative-accesssoundflower- We can't install these with homebrew, so grab them manually
- Games
sidequestsony-ps4-remote-playsteam
- Core system tools
brew install XXX(a small selection, seebrew.*.listfiles for more)aria2awsclicoreutilsdiveexiftoolffmpeggitgnupggogobustergoreleaserhubjqpcreqemuunrarwatchman
Unsorted
- Setup keys for git/etc (can/should we pull these from keybase, or configure new?)
- Once we have these, we should change the remotes for our dotfiles repo back to ssh
script/bootstrap- Setup commit signing automagically
- https://github.com/pstadler/keybase-gpg-github
- https://stephenreescarter.net/signing-git-commits-with-a-keybase-gpg-key/
- https://gist.github.com/bmhatfield/cc21ec0a3a2df963bffa3c1f884b676b
- https://stackoverflow.com/questions/38659198/gpg-sorry-no-terminal-at-all-requested-cant-get-input
- Setup commit signing automagically
- Automagically configure computer name
- Keybase
- Custom file type associations
- See https://github.com/0xdevalias/dotfiles/issues/5
- Enable FileVault encryption
- System Preferences -> Security & Privacy -> FileVault
- Enable Night Shift
- System Preferences -> Displays -> Night Shift
- Customize Trackpad
- System Preferences -> Trackpad ->
- Customize Hot Corners, etc
- TODO
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
- Backup
~/.netrc~/.localrc- any other 'local' dotfiles/etc?
- Keybase
- GPG keys (backup/export/revoke/etc)
- https://www.hackdiary.com/2004/01/18/revoking-a-gpg-key/
gpg --gen-revoke KEYIDgpg --import my_revocation.txtgpg --keyserver pgp.mit.edu --send-keys KEYIDkeybase pgp drop KEYBASEKEYID- Also make sure to remove any associations in GitHub if the keys were stolen
- https://github.com/settings/keys
- NOTE: this will make previously signed commits not verified, so maybe only do this if your secret keys were compromised
- https://stackoverflow.com/questions/45906495/what-happens-if-i-delete-the-gpg-key-from-my-github-account
- https://www.hackdiary.com/2004/01/18/revoking-a-gpg-key/
- Any macOS things required to cleanup/wipe a system before selling it
Legacy
- https://www.devalias.net/devalias/2013/06/20/what-i-use-osx/
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
- Vision
- 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.![]()
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:
- Universal Control: Use a single keyboard and mouse between your Mac and iPad
-
Use the keyboard, mouse or trackpad of your Mac to control up to two other nearby Mac or iPad devices and work seamlessly between them.
-
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
- Choose a name for this computer, configure it
- System Preferences -> Sharing -> Computer Name
- TODO: can we set this from command line as well?
- https://apple.stackexchange.com/questions/66611/how-to-change-computer-name-so-terminal-displays-it-in-mac-os-x-mountain-lion
sudo scutil --set ComputerName "newname"(required)sudo scutil --set LocalHostName "newname"(required)sudo scutil --set HostName "newname"(probably not needed)- Flush the DNS cache:
dscacheutil -flushcache(required?) - Restart computer (required?)
- Can also check current settings with
scutil --get ComputerName(was updated when I change computer name in system preferences)scutil --get LocalHostName(was updated when I change computer name in system preferences)scutil --get HostName("HostName: not set", even after configuring computer name in system preferences (but haven't restarted yet))
- https://knowledge.autodesk.com/search-result/caas/sfdcarticles/sfdcarticles/Setting-the-Mac-hostname-or-computer-name-from-the-terminal.html
- https://apple.stackexchange.com/questions/66611/how-to-change-computer-name-so-terminal-displays-it-in-mac-os-x-mountain-lion
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
cat ~/.ssh/github_devalias_ed25519.pub | pbcopy(this will copy it to the clipboard)- https://github.com/settings/keys
- Click "New SSH Key"
- Title:
[email protected] - Key: paste the key you copied above
- Click "Add SSH Key"
- TODO: add ssh config entry for GitHub
- Now we want to add the key to
~/.dotfiles/ssh/keys.initso thatssh-keyinitworks 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-keyinitonce after restarting our machine, and it will load the specified keys for us
- This file is just a list of the keys to be loaded with
- 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
cd ~/.dotfilesgit remote set-url origin [email protected]:0xdevalias/dotfiles.git
- TODO: automate this as part of
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 listkeybase pgp pull-private THEGPGKEYID(repeat for other keys as required)- Once this is done, you may want to update your
signingkeyin~/.dotfiles/git/gitconfig.local.symlinkgpg --list-secret-keys --keyid-format LONGgit config --file ~/.gitconfig.local --set user.signingkey THE16CHARKEYID- TODO: this should be automated as part of git config setup in
script/bootstrapor similar
- Once this is done, you may want to update your
- 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:
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