Managing dotfiles with homeshick
I am constantly using several different computers (home, work, servers) and synchronizing the configurations of the shell and all other command line utilities I am using across these computers can be a bit challenging. Manually copying everything including all changes constantly appearing in the different configuration files is the worst solution. So I have been using a repository on my self-hosted Seafile server with all the required dotfiles and a custom setup script to create the required symlinks to these files. This worked quite well but also had several drawbacks. Therefore, I recently switched to homeshick to manage my dotfiles and, during this process, published most of my dotfiles on GitHub.
Concerning the Seafile solution, the most prevalent issues why I wanted to switch away from this solution were:
- Lack of explicitness in the versioning system compared to e.g. Git: There are no comments for changes and therefore it is sometimes hard to figure out what changed.
- Setup effort: I do not want to run Seafile on every client I am working on. However, Git is usually available on every client and doesn't require a daemon.
- I do not want to provide credentials to my Seafile server just to use some dotfiles on a semi-trusted host.
For these reasons I was looking for a different solution, but this was never really an urgent issue.
Several months ago I stumbled across homesick, which synchronizes dotfiles using Git. I talked to a colleague about this, we both liked the idea, and then more or less forgot about this issue until a few weeks ago. At that time, the colleague told me that he had looked at homesick, decided against a Ruby dependency just for managing dotfiles and started using homeshick (mind the H), which is more or less a clone of homesick written in bash. Therefore, I also gave this a go and finally moved all dotfiles to the new system.
The first issue when starting to use homeshick or homesick is to decide how many git repositories (called castles) to use. Since several parts of my configuration differ between private computers, work hosts and servers, I decided to use a modular approach and created a castle for each program I use. Configuring the castles worked like expected apart from the fact that I had to fix some symlinks manually, which already existed from my previous solution. There is no way for homeshick to understand which symlinks to keep and which to replace in this situation, so I can't blame anyone about this.
Since I spent some time to configure my environment and people sometimes ask about my configuration files I decided to host them publicly on GitHub. At least all configuration files where I could remove sensitive information are now on my GitHub account as repositories starting with the "config-" prefix. Feel free to use these configurations and give feedback on them.
So far I am quite happy with the solution and everything works as expected. I did not investigate in how to manage the different castles, e.g. using repo or myrepos as proposed by the homeshick authors, but maybe I will try this out in the futures.