You can find mine here: http://github.com/adamgibbins/dotfiles
https://github.com/sophacles/dotfuse
It is a fuse filesystem that allows for modularization of some "single file" style dotfiles. Combined with git branche or modules (or both) it can get a lot of this (i hope). Warning though, it is still a bit of a toy, and I haven't played with it for a while, but I'm open to suggestions and pull requests!
As for dry with sourceable stuff, like bash/zsh configs, you can just keep the environment specific stuff in a separate repo, and use git modules, that is if your environ specific stuff needs to be confidential (or some of it) and kept in separate private repos.
If you want to see more, https://github.com/apinstein/dotfiles
I suppose another alternative might be having a private ".local" repo as a submodule, and having a rake task to concatenate and install the shared & local files. It is a tricky problem.
To me that might be better than using setup scripts for the various environments, and keeping it all in one branch (like I've seen other people do).
I'd prefer to see the differences by doing things like:
git diff master work
or git diff home work
etcRight now I use movein[1] to maintain my dot files. Each dotfile is held in it's own repo which is checked out to $HOME via GIT_DIR and GIT_WORK_TREE environment variables. The mr[2] command ties the git repos together as it if was one repo. I use additional repos or branches to handle variations within dotfiles. For work, I try to keep things confined to the relevent directory eg. using local.vimrc[3]
[1] http://stew.vireo.org/movein [2] http://kitenet.net/~joey/code/mr/ [3] https://github.com/embear/vim-localvimrc
Briefly: ~/dotstuff is a hg/git/whatever repo that contains your dotfiles, which can optionally use simple preprocessor directives to turn on or off different sections on different systems, or contain macro substitutions. You run 'dot' and it shows you a diff between what's in the repo and what's in your filesystem. Then run 'dot -g' to make the changes (with optional backups). Also manages crontabs.
I wrote it about four years ago and have been using it happily since then to manage dotfiles on 2-4 different systems. (I wrote the README today before posting this, which is why it has today's date.)
Then, my config files are "make"'d by concatting three files: cat "$1.first" "$1.`cat ~/.hostclass`" "$1.end" > ~/.$1
This lets me split out specific parts into a hostclass-specific file.
Generally, I set variables in these files that gets used in the $1.end file.
It works pretty well for me, since my hosts are generally pretty close to each other.
edit: might as well link my repo, which doesn't yet include that functionality: https://github.com/drewfrank/dotfiles
https://github.com/halostatue/dotfiles
I've been slowly moving toward a 'detect-and-configure' plug-in system that I'm quite happy with.
I don't use ruby and don't want to install rake on each machine for something that should be possible with a simple shell script, and didn't like the scripts I saw so far. Everything had a medium or large aspect that kept me from using it.
Maybe I just need to write my own thing.
Whenever I set up a new machine, I always do this:
git clone git://joshtriplett.org/git/home
mv home/.git .
rm -rf home
git checkout -f
(There probably exists a simpler way to do that, but I haven't found it yet.)I can always check out my repository via git:// even on a machine where I want to push to it, because my repository includes a ~/.gitconfig containing:
[url "ssh://joshtriplett.org/"]
pushInsteadOf = "git://joshtriplett.org/"
So, I can automatically push as long as I have SSH access to my server. (I wrote the support for pushInsteadOf in upstream git, specifically to enable this use case.) git init .
git remote add origin git://github.com/eentzel/dotfiles.git
git checkout -t origin master DOTFILES=$HOME/where/the/dotfiles/live/in/git
for T in $DOTFILES/*; do
TARGET=$(readlink -e $T)
LINK_NAME=$($HOME/.$(basename $TARGET))
# test if a file, working symlink, or broken symlink already exists
if [ -e $LINK_NAME -o -L $LING_NAME ]; then
CURRENT_TARGET=$(readlink -m $LINK_NAME)
if [ $CURRENT_TARGET != $TARGET ]; then
echo "$LINK_NAME already exists and is really $CURRENT_TARGET"
fi
fi
ln -s $TARGET $LINK_NAME
done
Remove stale dotfile symlinks: for L in $(find $HOME -maxdepth 1 -type l -name '.*'); do
if [ ! -e $L ]; then rm $L; fi
done
This assumes you'll use git excludes to keep files you don't want out of your repository. E.G. if you don't want $HOME/.ssh/id_rsa in git then you'd have $DOTFILES/ssh/.gitignore with 'id_rsa' in it. If you try to manage your excludes through the linking you'll end up with a very ugly script like what I have at https://github.com/sciurus/dotfile_management[1] https://github.com/justone/dotfiles [2] https://github.com/sorin-ionescu/oh-my-zsh
http://git.kitenet.net/?p=joey/home.git;a=blob_plain;f=bin/d...
Would you suggest having the physical files in ~/ and adding their symlinks to a repo?
I'm sure many others like myself would appreciate a more thorough, introductory walkthrough. I'll be asking my more hard-core friends for guidance in the meantime.
A lot of Ruby people seem to add a Rakefile or a Ruby script to do some simple task like installing a few dotfiles. That makes them a lot less useful to me (for example), as I don't have a Ruby env available on all machines I use.
Same goes for Node.js, Python and Perl people. If a "standard unix" tool can do something almost as easily as a Rakefile/whatever, you should probably stick to the standard tools. I don't know what you should do with Windows, though.
(shameless plug) Kindness: A nice way to bootstrap your box (with chef) http://joshtoft.com/kindness/
It takes advantage of site-cookbooks with Chef, letting you bring in your own site-cookbooks and also takes your chef-solo.json (if it exists).
I made it to get away from the rake dotfile sillyness.
Conforming to the XDG base dir standard as much as possible makes sense but can get painful sometimes (e.g. vim: http://tlvince.com/2011/02/03/vim-respect-xdg/).