Castle 11 from Bill Ward's Brickpile. (CC BY 2.0)
Since quite a while I try to find a good solution for sharing my dotfiles between my different computers.
I started with chef. - Unfortunately this did not work so well. Especially if you also want to use your dotfiles on a server. Also it feelt a little complicated.
The next approach I took was putting my dotfiles into my Dropbox and symlink them. This worked ok. But Dropbox on a server? No way.
So I keept looking. A few days ago I stumbled over
homesick - an amazing rubygem that manages your dotfiles.
How to set it up
First install homesick:
gem install homesick
Now create a "castle". A castle is a collection of dotfiles.
homesick generate ~/dotfiles
This creates a git repro with a /home folder inside. Just put your dotfiles / dotfolders in there. Then push the stuff to Github.
Now install the castle with homesick.
homesick clone https://github.com/foo/dotfiles.git
Now let homesick do its magic.
homesick symlink dotfiles
All the dotfiles from within this castle will be symlinked.
This is awesome!
- You feel at home at each of your servers in no time
- You share your dotfiles with the world
- You can learn from others and refine your files
- You can put essential little scripts into a .bin directory.
- The castle concept allows you to try someone elses dotfiles
A word of caution
Please do not put sensitive informations into you dotfiles.
Especially ssh keys, bash histories and passwords in configuration
files do not belong on Github.
Seriousely. It's magical. This is one of those things that you try out and you ask yourself how you could possibly live without it.
Interested? Have a look at my dotfiles.