This is the computer setup / dotfiles repo for Thimble!
It was forked from https://github.com/webpro/dotfiles to give us a setup to our computers that would be scripted and standardized.
- The repo uses Homebrew to install many (packages: Brewfile)
- homebrew-cask to install many (apps: Caskfile)
- Mise, where possible, for languages and libraries like ruby, pnpm, etc.
A default installation using this includes:
- Ruby, Python, NodeJS all installed
- Postgres (with a setup for managing multiple postgres versions)
- Redis
- iTerm2 as a suggested terminal app
On a sparkling fresh installation of macOS, first install software updates and developer tools. The Xcode Command Line Tools includes git and make (not available on stock macOS).
sudo softwareupdate -i -a
xcode-select --installThen add a new ssh-key to your machine, and your Github account.
Clone the dotfiles onto the machine:
git clone git@github.com:thimble-consulting/dotfiles.git ~/.dotfilesThen ensure you update the dotfiles settings to your preferences. At a minimum, we suggest updating in macos/defaults.sh the COMPUTER_NAME to a preferred name.
COMPUTER_NAME=<switch-from-default>
Some other settings in that file that you may wish to edit include:
LANGUAGES
LOCALE
And in the system/.env file, you may wish to update the default editor (VSCode) and other vars:
export EDITOR="code"
export VISUAL="code"
export LC_ALL="en_US.UTF-8"
export LANG="en_US"
Use the Makefile to install the packages listed above, and symlink runcom and config files (using stow):
cd ~/.dotfiles
makeRunning make with the Makefile is idempotent. The installation process in the Makefile is tested on every push and every week in this
GitHub Action. Please file an issue in this repo if there are errors.
- Set your Git credentials:
git config --global user.name "your name"
git config --global user.email "your@email.com"
git config --global github.user "your-github-username"- Set macOS Dock items and system defaults:
dot dock
dot macos-
Start the RectangleApp and check in its settings that it is set to start on login.
-
Start Alfred and check in its settings that it is set to start on login.
-
[Optional] Change the mac Cmd-Space Keyboard Shortcut to open Alfred instead of Spotlight
i. First, go to System Settings > Keyboard > Keyboard Shortcuts > Spotlight and disable the Cmd-Space setting ii. Then, in Alfred, set the shortcut to Cmd-Space
- [Optional] Add some Alfred productivity settings:
i. One great way to use Alfred for opening often-used things is to enable Web Bookmarks search in Alfred. Go to Alfred Preferences > Features > Web Bookmarks, and enable Alfred to search bookmarks. Then, if you've bookmarked key repos, standup, task boards or other things, you can search for these in alfred and open them from there.
The repo uses topgrade to run software updates. This is a library that automates checking if other libraries/systems need to be updated, including Homebrew, Mise, MacOS, Visual Studio Code Extensions and more. To run these updates just run:
topgrade
If/when you make changes to existing dotfiles, check them into git and push them up. We haven't decided on a way to manage the dotfiles as a team - let's explore as we go, with the aim of having the main repo be a common starting point, and individual settings maintained separately. Perhaps we create individual forks off this main repo and merge back in common settings.
If/when you add new configs to your machine, check them into the repo like other dotfiles.
$ dot help
Usage: dot <command>
Commands:
clean Clean up caches (brew, cargo, gem, pip)
dock Apply macOS Dock settings
edit Open dotfiles in IDE ($VISUAL) and Git GUI ($VISUAL_GIT)
help This help message
macos Apply macOS system defaults
test Run tests
update Update packages and pkg managers (brew, casks, cargo, pip3, npm, gems, macOS)
To manage Postgres versions, we're using an approach outlined on this post.
The main parts to know are:
- To install a specific version of postgres, add
brew "postgresql@<version-number>"to theinstall/Brewfileand then runmake - To create a new cluster of a specific version, run
pg_createcluster <version> <cluster-name>. A nice default is to name your clustermain, e.g.pg_createcluster <version> main. - To run commands on a cluster, run
pg_ctlcluster <version> <cluster-name> <cmd>. To start main on v17, for ex,pg_ctlcluster 17 main start.
Redis is installed with Homebrew as well. We recommend not starting redis or postgres at system start, and instead run them when you need to. To run redis, you can just run redis-server. Or, to run it in the background, redis-server &.
To customize the dotfiles to your likings, fork it and be the king of your castle!
Many thanks to the dotfiles community.