This repository contains the configuration and tools that I use on a day to day basis as a software developer. I made this mainly for my own safe-keeping and for when I need to set up new environments, but feel free to take this and make it your own.
This set up is currently tested for macOS 12 Monterey on Intel, and also on Apple Silicon with some minor additional steps. Compatibility for other versions of macOS is not guaranteed.
bash
,zsh
orfish
: a shell to run commands incurl
: to download stuff- internet
If you are on an Apple Silicon machine, there are a few additional steps to set up before installation. If you're on an Intel machine, you can skip these steps.
In bash
or zsh
:
echo "export PATH=/opt/homebrew/bin:\$PATH" > ~/.zshrc
If you're using fish
:
fish_add_path /opt/homebrew/bin
Running the commands below will download the repository to $HOME/.dotfiles
by default (you will be
given the option to customise this), then run the scripts/install.sh
script.
In bash
or zsh
:
bash <(curl -Ls https://raw.github.com/benyap/dotfiles/main/scripts/bootstrap.sh)
If you're using fish
:
bash (curl -Ls https://raw.github.com/benyap/dotfiles/main/scripts/bootstrap.sh | psub)
A couple of other useful things that I also do but couldn't figure out how to automate with scripts:
Some of the values in home/.config/fish/fish_variables
have the absolute path to the home
directory hardcoded. When installing on a new machine that has a different home directory, this file
will need to be updated.
- Import non-sensitive configuration from assets/raycast/public.rayconfig. This should include all preferences, quicklinks and script directories.
- Import extensions configuration from assets/raycast/extensions.rayconfig. This file is password protected.
- As a reference for those checking out my repository and won't have the password to the extensions configuration, a list of extensions I use is exported to assets/raycast/extensions.json.
- Import Profiles.json, which contains the OneDark color scheme and some nice editor-style keymappings
- Import Panels.itermkeymap, which contains additional keymappings that give nice shortcuts for managing and navigating panes
NOTE: Currently there aren't any post-install scripts to run
You may want to run this to do some additional symlinking after completing the manual steps.
Navigate to the root of the project and run the post.sh
script:
./scripts/post.sh
Known issues
- Installation path for Homebrew has changed from
/usr/local/bin
to/opt/homebrew/bin
Changes to make when on Apple Silicon
Install scripts have been modified to address issue 1 when these scripts are installed on machines with an Apple Silicon chip.
The following manual steps are required:
- Raycast scripts written in JavaScript (found in the
home/.config/raycast
directory) must have their shebang lines changed from#!/usr/local/opt/node@16/bin/node
to#!/opt/homebrew/opt/node@18/bin/node
To update from the remote, simple do a git pull
and run ./scripts/install.sh
.
If you've made local changes that require updating or installing packages, simply run
./scripts/install.sh
.
There are a few places where you can put things that need to be environment specific or that should
not tracked in git
. They are:
home/.gitconfig.local
- useful for customising git for your environment (seehome/.gitconfig.local.template
)home/.zshrc.local
- useful for customisingzsh
home/.config/fish/config.fish.local
- useful for customisingfish
home/.config/raycast/local
- useful for adding Raycast scripts that have sensitive information hardcoded
Used to download and set up the dotfiles with zero dependencies. Like, you literally only need a
shell and curl
which should be be installed already.
- Source helper functions from
scripts/utils.sh
. If it doesn't exist, download it, then source it. - Check if the script was run inline (e.g. using the install command from this README). If it was, it'll download this repository as a zip and extract it so that it has all the other scripts available.
- Run the
install.sh
script to do the rest of the work.
Does the grunt work of setting everything up.
- Source some utilities and helper functions -
scripts/utils.sh
. - Ask for
sudo
(and keeps the sudo state refreshed until the scripts finish). - Install core tools that are needed to install the rest of the stuff (XCode command line tools, git, Homebrew).
- Set up the folder as a
git
repository so that any changes can be tracked. - Install utils / commands using Homebrew.
- Install apps using Homebrew Cask.
- Symlink configurations from the repository to where they should live in
$HOME
.
There are a few spots where the setup / configs couldn't be "generalised", so it may have my home directory (benyap) hardcoded. If you want to fork this and make it your own, here are a few things you will need to do before you try to install it on your machine:
scripts/bootstrap.sh
- setREPOSITORY
variable to your own repositoryscripts/install.sh
- setREPOSITORY_ORIGIN
variable to your own repository's originhome/.config/fish/fish_variables
- some of the variables have my home directory baked in, so you will need to rename these
The home
directory in this project more or less tries to mirror what would be symlinked to your
actual home directory. It's pretty easy to add more things you want to symlink - have a look at
scripts/tasks/setup/setup_symlinks.sh
.
These are some key repositories I drew inspiration (and maybe even "borrowed" some code) from to build my own configuration. Lots of cool ideas in these.
- https://github.com/mathiasbynens/dotfiles
- https://github.com/caarlos0/dotfiles
- https://github.com/caarlos0/dotfiles.fish
- https://github.com/alrra/dotfiles
- https://github.com/gf3/dotfiles
- https://gist.github.com/shreeve/188ee4a8dff52d1000777364101c133d
- https://sourabhbajaj.com/mac-setup
- https://github.com/benedictong42/dotfiles
MIT license. Feel free to use, or fork and make it your own.