Dotfiles
One of the things that I have been thinking about recently is how to make my Dotfiles more modular.
One unified repository for all my dotfiles has been there for years. I thought it would serve my purpose ideally, all my configurations and setup should be identical across different systems. But that’s not the case in reality. I have been working on different operation systems - macOS, ArchLinux and NixOS etc. On each system, the configuration is slightly different. Yet, different tools only work on specific systems. For instance, on Linux I have a bunch of windows management scripts, while on macOS it’s trivial.
To have a full backup of dotfiles for each system, it becomes too bloated and no commonality for sharing. It also involves too much work to extract and merge across different branches. I need a way to share the same configuration across different systems. At the same time, each has own customization respectively.
I decided to create a base set of tools configurations that are common to use and share. Based on that, I can have a separate repository for each system to include system-specific configs.
git submodule is perfect for this purpose to include the base configurations. GNU Make will be used to manage the links and setup.
By doing this, I can have a common set of configurations in one place, and have other opinionated configurations in different repositories.
That’s why I created dotbase.
It’s a base set of my recommendations and hopefully it can be useful for others. I only pick the essential tools that I use the most and it’s worth sharing. I borrow the concepts from tpope’s vim-sensible, which is a set of sensible defaults for Vim. The goal of dotbase is to provide a set of sensible defaults for macOS/Linux tools I use.
Here are my repositories working in progress.
- dotbase - Base Dotfiles - a collection of essential dotfiles
- dotmac - Dotfiles for macOS based on dotbase
- dotnix - Dotfiles for NixOS based on dotbase
➜ dotbase git:(main) tree -L 2
.
├── LICENSE
├── README.md
├── nvim
│ ├── init.lua
│ └── lua
└── tmux
└── tmux.conf
I would love to hear your thoughts on this.
-mgc