I've started organizing my dotfiles in a repository, which has been super helpful for keeping track of configurations that go into the ~/.config directory. However, I'm looking to expand this practice to include configurations outside my home folder, like those in /etc and /usr. For example, I need to add a custom logind configuration, and the documentation suggests placing a new file in /etc/systemd/logind.conf.d/. I'd love to incorporate these changes into my dotfile repo, but I'm unsure how to manage this effectively. I currently use GNU Stow for symlinking files in ~/.config, and I'd like to know if it's advisable to use it for /etc configurations as well. Are there best practices I should be aware of?
5 Answers
Just create symlinks for all the folders and files you're concerned with. Keep those symlinks organized in a single folder for your repo. This way, all your git commands will function as if those configs are really stored in your repo!
The recommendation to put your configuration changes in /etc/systemd/logind.conf.d/ aligns with a best practice. Systemd configurations look for directories ending in .d and append the contents of any configuration files alphabetically, which allows for modifications without changing the original file. This is useful for managing your dotfiles without disrupting default configurations.
Try using XDG Ninja to see if there's anything you can clean up from your home directory. If you want a more robust solution, check out ChezMoi; it's great for managing dotfiles across different locations!
You can definitely make this work! Consider using sudo with Stow to manage the symlinks in /etc. Check out the Stow manual for more details on how to set it up properly.
I've developed a tool that simplifies managing these configurations if you need any guidance. Feel free to check it out here: [pdrx](https://github.com/stefan-hacks/pdrx).

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures