News for hackers. Stuff that matters.
Re:Using GNU Stow to manage your dotfiles by LukaD on Tuesday October 21, 2014 @01:46PM (#8488623)
This is how I manage my dotfiles since I discovered stow a couple of months ago.

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.

Re:Using GNU Stow to manage your dotfiles by mjcarroll on Tuesday October 21, 2014 @02:06PM (#8488771)
I also use stow to manage my common personal dotfiles, as well as my employer-specific dtofiles. The way I do this is to keep my general files in my dotfiles repository, but then keep work specific ones in a separate repo (dotfiles-employer).

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.

Re:Using GNU Stow to manage your dotfiles by anu_gupta on Tuesday October 21, 2014 @02:05PM (#8488765)
Not sure if this would work with Stow, but in my .bashrc I just do this:

  if [ -f ~/config/bashrc_$(hostname -s) ]; then
        source ~/config/bashrc_$(hostname -s)
  fi
this gives me machine specific configs.
Re:Using GNU Stow to manage your dotfiles by jackalope on Tuesday October 21, 2014 @02:14PM (#8488828)
You can do something similar to target *nix platforms like Darwin|FreeBSD|Linux|NetBSD|OpenBSD with:

  if [ -f ~/config/bashrc_$(uname -s) ]; then
      source ~/config/bashrc_$(uname -s)
  fi
Re:Using GNU Stow to manage your dotfiles by LukaD on Tuesday October 21, 2014 @02:23PM (#8488876)
Great idea! It wouldn't work for me though as I tend to call all my machines 'fuckup' (I know...) ;)
Re:Using GNU Stow to manage your dotfiles by RexRollman on Tuesday October 21, 2014 @08:53PM (#8490993)
In that case, you could have it read or check the existence of something else, like a file in /etc.
Re:Using GNU Stow to manage your dotfiles by philsnow on Tuesday October 21, 2014 @05:15PM (#8490062)
> 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.

A 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.