I have emacs deployed on multiple systems. While most of the configuration is common to all of them I am not sure on how to track and deal efficiently with the variations for each system. For example, I have some dedicated configuration for the system I use at work, so I need to track the specific configuration with tools provided by my employee or customer, while tracking changes to the common configuration with “public tools”.
I tried dotgit to that end, but I don’t feel at ease with it and I don’t think it is pertinent when some part of the configuration is not “public”.
Any recommendation for managing emacs configuration across systems?
I use M-x customize (and save it to a separate custom.el). I suppose
you could also create a local-init.el for manual editing (and load
that in your init.el). Please don’t bother trying to sync these things
(Speaking from experience, it is not worth it).
I try to mostly keep things in my custom.el file (ala M-x customize), but I do have a number of “modules” I use as well. All of that is kept in version control. When I go to a different computer (like for work or a client computer that I’m going to have for a while) I just keep specific configuration for that environment in it’s own module. I don’t always sync that module in version control because it largely only applies to the system it’s on, not to anything else. If there is configuration there I want to keep, then I put it with the rest of my Emacs configuration. For me, non-public facing customization is mostly related to passwords which I store in either GNU Pass or $HOME/.authinfo.gpg on the local machine where it is needed.
Regardless, pick the way that feels right to you and go with it. If it has rough edges, smooth them out according to your needs and workflow. The above description of how I do it may not work for you.
I use a git repository for my configuration. In there, I keep machine-dependent config in a separate file named after the host name which gets loaded from the the main configuration depending on the current host name at load time.
As you likely have already noticed you have to make the choice between dividing your configuration by topic (e.g. keep customisation near package loading code) or by place (machine-dependent files). You cannot have both to play out in ideal fashion, but you can use a mixture of both. This brings its own problems of keeping similar customisations in separate places etc.