For system personalization, easy set-up, &c &c.
This repo is really just for me, and I'll be honest and say that right now. I also don't have a lot of different machines, so it tends to be more targetted and less robust for widespread use than other dotfiles repos you may find. With that said, I'm far from against other people using any of this. I just felt I should make that clear.
Also, if you want to use these dotfiles, I strongly suggest you first review the contents and see what works for you. Make your own copy. It's all about personalizing a system to you, not just blindly using someone else's settings. You could be in for a bad time if you do that.
This can be cloned wherever you like, but I like to keep it along with other projects in ~/dev/projects/mine. The bootstrap
script will create the ~/.dotfiles symlink, among other things.
git clone https://github.com/ymendel/dotfiles.git
cd dotfiles
script/bootstrapscript/bootstrap does most of the work. These are the parts it can't do, along with
the things worth knowing before you start.
- Consider the username carefully If anything is copied over from another machine
and expects a certain absolute path, using a different username is an easy way to
mess that all up. Despite being
ymendelin many places (including GitHub), I tend to useyossefas a username on my personal machine. - Install Xcode Command Line Tools Nicely, this will automatically happen the first
time
gitis run, so thegit clonewill take care of this. Then Homebrew may well install them again. - Sign in to the App Store
brew bundlerunsmas, which needs to authenticate on the App Store. It's not necessary to do this step before bootstrapping, but it does save a prompt-and-wait later. - Terminal profiles install by being opened and this leaves four Terminal windows to be closed. This is expected.
- Set the default Terminal profile by hand once those profiles are imported.
macos/terminal/terminal.defaultstries to do this, but it doesn't work. Read theFIXMEcomment in that file if you care. - The first run takes a long time. Homebrew formulae and casks, App Store apps, and
a Ruby that
ruby-installbuilds from source all land in the same run. - Log out or restart at the end — which the macOS installer will tell you to do anyway. Several of the defaults won't take effect until a particular app is restarted, and some of those apps are things like Dock and Finder and SystemUIServer — pretty annoying to quit/restart. Some others really won't take effect until login, so the surest course of action is to just restart the computer.
This is separated into topic directories. Instead of a single large file (or a small set of large files) to handle everything,
things are broken up into small directories and files (viz. git, ruby, system, shell, macos). I find it easier to
understand and handle with this separation.
- script/: This is the location for scripts and commands that handle the dotfiles project itself, like
script/bootstrap. Note thatscript/bootstrapruns before Homebrew is installed, so anything in here — and anything it sources — has to work on the/bin/bashthat macOS ships, which is still 3.2. That means nomapfile, no namerefs, and no associative arrays. Everything loaded later (viz. the topic/*.bash files) gets Homebrew's bash and can use all of it. - bin/: This gets added to the
$PATHand anything in here is available to run everywhere. This is a sort of general, catch-all location for commands and utilities that don't fit elsewhere. Also,updotlives here. (see below) - topic/bin/: These directories also get added to the
$PATH, for topic-related commands that will be made available to run everywhere. - topic/*.bash: Any files ending in
.bashget loaded into the environment. - topic/install.sh: Any file named
install.shis executed byscript/install(which is run byupdot). These end in.shinstead of.bashto avoid being loaded automatically. - topic/*.symlink: Any file ending in
.symlinkgets symlinked into$HOMEwith a prepended.(e.g.git/gitconfig.symlink→~/.gitconfig) This lets all of these files stay versioned in the dotfiles repository, but still be useful in their expected locations. These files are symlinked by bothscript/bootstrapandscript/install(which is run byupdot). - topic/config/: Anything under here gets symlinked into
$XDG_CONFIG_HOME(~/.configwhen that isn't set), keeping whatever path it had belowconfig/(e.g.editing/config/zed/settings.json→~/.config/zed/settings.json). Note that it's the files that are linked, and not the directory, because that directory might be used by something else. As with the *.symlink files, these are symlinked by bothscript/bootstrapandscript/install(which is run byupdot). - ~/.local/bashrc: This file will be sourced if it exists, allowing you to have special per-machine differences.
- ~/bin, ~/scripts, ~/.local/bin: These get added to the
$PATHas well — each one only if it exists.
The updot command is provided to easily stay up-to-date. It installs dependencies, runs install scripts, sets defaults, &c.
Run this script occasionally to keep your system and environment up-to-date.
Note: Running updot will not update the git repository, and this is by design. It only updates the system with
the current contents of the repository. It also (by design) doesn't update already-installed Homebrew formulae. Those can
be handled separately with brew.
updot brew does only the Homebrew part: install/update Homebrew, then brew bundle each
Brewfile that applies to this machine.
(Note: That is some git-style subcommand handling, where it calls updot-brew. You can make
your own subcommands by creating updot-* executables. Have fun!)
This organization was largely inspired by Zach Holman and his wonderful dotfiles repo. There were some things I wanted to do differently. Some of those I gave up on simply because his stuff was so good.
Along the way, I've gotten a good bit from other repos. Of particular note, and in no particular order: