How can I manage my configuration files and dotfiles beyond just the home directory?

0
8
Asked By CuriousCoder42 On

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

Answered By SymlinkWizard On

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!

Answered By ConfigGuru On

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.

Answered By CleanUpNinja On

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!

Answered By StowMaster98 On

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.

Answered By ToolMaker47 On

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.