Live data from Hacker News

Using GNU Stow to manage your dotfiles (2012)

brandon.invergo.net

1–10 of 116 posts

Re: Using GNU Stow to manage your dotfiles (2012)

#2
I use this technique, based on a bare git repo https://www.atlassian.com/git/tutorials/dotfiles

Works quite well ... but I'm really, really ready for a rebuild of how Linux systems are built. I hope systemd-homed will deliver.

Imagine you could ssh into a machine with a flag that forwards your local config. Or even your local bin.

Re: Using GNU Stow to manage your dotfiles (2012)

#3
I’ve been using stow to manage my dotfiles for a long time, works very well.

Recently I’ve moved to NixOS and have been considering trying out Nix’s home-manager (mostly just out of curiosity - I’m perfectly happy with stow). If anyone has tried both stow and home-manager, I’d be interested to know your thoughts on how they compare.

Re: Using GNU Stow to manage your dotfiles (2012)

#4

I use this technique, based on a bare git repo https://www.atlassian.com/git/tutorials/dotfiles Works quite well ... but I'm really, really ready for a rebuild of how Linux systems are built. I hope systemd-homed will deliver. Imagine you could ssh into a machine with a flag that forwards your local config. Or even your local bin.

That sounds really convenient. How far away is the homed system from adoption?

Re: Using GNU Stow to manage your dotfiles (2012)

#6

I use this technique, based on a bare git repo https://www.atlassian.com/git/tutorials/dotfiles Works quite well ... but I'm really, really ready for a rebuild of how Linux systems are built. I hope systemd-homed will deliver. Imagine you could ssh into a machine with a flag that forwards your local config. Or even your local bin.

You mean what we had with project Athena for decades? Or NFS mounted homework? Or plan 9?

Re: Using GNU Stow to manage your dotfiles (2012)

#7
I have found that managing dotfiles is not enough. The dotfiles serve no purpose without the software that uses them. My method is to write small scripts, I call them setuplets, that install the software and then symlink the dotfile to its master that I manage in git. In the simplest case, it is just a two line script in a directory, but I have one for each program, and a tool to select which I run when setting up a new linux machine. The more complex ones may install a number of tools and set up environment variables etc. For environment variables, the script drops a script file in a directory, where my bashrc sources it.

Re: Using GNU Stow to manage your dotfiles (2012)

#8
post #6

I use this technique, based on a bare git repo https://www.atlassian.com/git/tutorials/dotfiles Works quite well ... but I'm really, really ready for a rebuild of how Linux systems are built. I hope systemd-homed will deliver. Imagine you could ssh into a machine with a flag that forwards your local config. Or even your local bin.

You mean what we had with project Athena for decades? Or NFS mounted homework? Or plan 9?

NFS, The Network is the Computer (TM).

It's a bit strange that now it's a Cloudflare trademark.

Re: Using GNU Stow to manage your dotfiles (2012)

#9
post #7

I have found that managing dotfiles is not enough. The dotfiles serve no purpose without the software that uses them. My method is to write small scripts, I call them setuplets, that install the software and then symlink the dotfile to its master that I manage in git. In the simplest case, it is just a two line script in a directory, but I have one for each program, and a tool to select which I run when setting up a…

I've been logging each install as a markdown document with directions, and manually symlinking my dotfiles, but tiny scripts that do both are a great idea!

Re: Using GNU Stow to manage your dotfiles (2012)

#10
I really like this method as opposed to using a bare Git repository. For one, it's conceptually simpler in my mind; you don't have to understand Git internals to get this working. Secondly, this lets you pick and choose which config files you want to "install" on a machine.

I feel obligated to share my Bash script, dotfiles.sh[1], that accomplishes what Stow does, but with a few tweaks that I found particularly useful:

dotfiles.sh targets the user's home directory by default (i.e. stow -t $HOME).

dotfiles.sh never symlinks directories, only files (i.e. stow --no-folding). (This was the straw that broke the camel's back and made me roll my own script in the first place.)

dotfiles.sh makes backups of local config files and can restore them if you remove your symlinked version.

My script is quite old now, and I use it so seldomly I'm not convinced there aren't bugs. YMMV.

[1]: https://github.com/kevin-hanselman/dotfiles

Post reply on HN