by LukaD · 12y ago · 0 comments
The only thing that bugs me is that I haven't figured out an elegant way to have some configs include machine specific configs. For example a set of bash aliases that I only use at work but don't want at home.
My best idea is to source all files in, say ~/.bashrc.d and put machine specific configs in there... Haven't tried it out yet.
This separate repo has .private versions of all of my commonly used dotfiles (for example .bashrc.private), and my top-level files will check for the existence and source these, if present.
Both repos will be installed using stow, with the work dotfiles generally just extending the personal dotfiles.
if [ -f ~/config/bashrc_$(hostname -s) ]; then
source ~/config/bashrc_$(hostname -s)
fi
this gives me machine specific configs. if [ -f ~/config/bashrc_$(uname -s) ]; then
source ~/config/bashrc_$(uname -s)
fiA fair amount of the time when I'm setting up a .foorc, I'll want to add some functions to bashrc, or change a MANPATH or something, so this pattern is useful for that too; you could just have a ~/dotfiles/.bashrc.d/foo.sh and have your .bashrc unconditionally source everything in ~/.bashrc.d/. Then when you use stow to setup foo, its bashrc modifications get installed too.