Using GNU Stow to manage dotfiles (2013)
brandon.invergo.net
brandon.invergo.net
git clone --bare https://example.com/myconfig.git $HOME/.myconfig
echo "alias myconfig='git --git-dir=$HOME/.myconfig/ --work-tree=$HOME'" >> $HOME/.bashrc
source $HOME/.bashrc
myconfig checkout
...and it's done. Getting stow on a machine that doesn't have it is probably more work.With that said, i did forget the commands, and had to lookup the article. I knew how it worked, a sort of redirected git repo usable from anywhere, and used with an alternate command, but I just didn't remember the commands offhand.
The nice thing is too, is that the initial setup of things like the "myconfig" command (I use `dot`) only requires being setup once, even after switching machines. Since a new machine just requires you to setup the git repo with a couple (hard to remember lol) commands, and then suddenly your `dot` command works "magically". Because of course, it's included in your dot files.
It really is magical, and shockingly simple. I've been using it for over a year now and am fully happy.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install stow
stow *
or apt-get install stow
stow -v *FWIW I don't actually use stow, I just wrote a simple Python script to do it[0]. It doesn't handle deleting things but it just means I don't have to mess about having a special non-standard git repo in $HOME, I can just treat my dotfiles like any other git project I have.
[1]: https://github.com/meribold/dotfiles [2]: https://dotfiles.github.io/#general-purpose-dotfile-utilitie...
I am not denying the usefulness of this post. I came across this when I was setting up stow myself.
It doesn't have any external dependencies, unless you consider python an external dependency, but most all distros come with that built-in these days.
It's not a management system either. It's just a tool for describing where to copy things to. So if you simply choose not to use it later it's not that difficult to migrate.
You can't just have multiple .bashrc files that get linked to the same ~/.bashrc destination, but you can have a ~/.bashrc.d directory and have the end of your central .bashrc source everything in that directory (in some well-defined order). then your vim app subdirectory could add shell aliases/functions for, say, invoking vimdiff in a particular way, by adding a file in ~/dotfiles/vim/.bashrc.d/vim.bashrc .
Although I'm looking at NixOS now ...
It is a never-ending cycle, it seems. :)
If you want to define your /home contents statically (because, for instance, you're running a single-user home machine and you consider your dotfiles part of your system configuration), you should instead create a /etc/users/<name> directory and set it as the home directory for your user. NixOS then allows you to define its contents as part of configuration.nix, just like anything else under /etc.
The great part is that I can keep branches for each computer which share my configuration. And being that I consistently use Arch, I also employ an install script with my common packages to speed up new installations.
In the end, it shaves a good hour or so off my installation process.
Or another option with more tooling like would be something like yadm [2].
[1]: https://github.com/lutostag/dotfiles [2]: https://thelocehiliosan.github.io/yadm/
If you just use stow for basic dotfiles management, confetti will also work just fine, but is less general than stow.
Author hasn't heard of `ln`?