Using GNU Stow to manage your dotfiles (2012)

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • OPS - Build and Run Open Source Unikernels
  • Scout APM - Less time debugging, more time building
  • SonarQube - Static code analysis for 29 languages.
  • Home Manager using Nix

    Manage a user environment using Nix [[email protected]]

    I used to do this for macOS and Linux but it was a fragile approach, since using Nix and NixOS I've had great success using home-manager[0] which takes care of what software is installed and any overrides or patches I desire.

    I also use GNU stow in my dotfiles[1] especially so that my setup still works on systems without Nix installed.

    [0] https://github.com/nix-community/home-manager

    [1] https://github.com/siraben/dotfiles

  • dot.me

    me dot files

    STOW is great, it is simple and works well especially combined with git. That's what I do [0], and recently combined it with org-mode for literate programming, so each program has just a README.org that then generates all the files via org tangle [1] [2]. For example, here is my file that generates my Xorg configuration [3] over several files, nicely readable on GitHub, in Emacs, or just as plain text.

    [0] https://github.com/podiki/dot.me/

    [1] https://web.archive.org/web/20190924102437/https://expoundit...

    [2] https://orgmode.org/manual/Working-with-Source-Code.html

    [3] https://github.com/podiki/dot.me/tree/master/x11

  • OPS

    OPS - Build and Run Open Source Unikernels. Quickly and easily build and deploy open source unikernels in tens of seconds. Deploy in any language to any cloud.

  • dotfiles

    You don't need symlinks, setup scripts, etc. Try this:

    1. Bare git repo in your home directory ($HOME/.files)

    2. Alias for prefixing git commands ("env GIT_WORK_TREE=$HOME GIT_DIR=$HOME/.files")

    3. Strict .gitignore file (that ignores all files by default)

    Simple to add files: `h git add .vimrc`

    Have this set up for myself. Works great https://github.com/tmm/dotfiles

  • stowage

    Stow-like tool with a backup feature, designed for keeping dotfiles under version control via symlinks (by michaelpb)

    That's what I do too. I even made a little Stow-inspired tool to help me, called "stowage", if you are curious: https://github.com/michaelpb/stowage

  • vcsh

    config manager based on Git

    It’s over-engineered, but I’ve been using https://github.com/RichiH/vcsh for this for years.

  • nix

    my nix stuff (by jpetrucciani)

    +1 for nix and home-manager - I recently switched to this setup (still learning/experimenting a lot, link here [0]) and have been very happy!

    [0]: https://github.com/jpetrucciani/nix

  • zinit

    Flexible and fast Zsh plugin manager with clean fpath, reports, completion management, Turbo, annexes, services, packages.

    I have a similar setup, but I don't have to write that script myself. Instead, I uses Zinit (https://github.com/zdharma/zinit) to let it setup the tools for me.

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

  • bashdot

    Minimalist dotfile management framework.

    I've been using bashdot(https://github.com/bashdot/bashdot) does exactly this. It's a simple bash script that sets up symlinks for a given directory. It can also switch symlinks to different directories, so you could use that as swappable profiles.

  • dotfiles

    I've been doing something similar.

    Basically adding a alias to my zshrc, that runs: `git --git-dir=$HOME/dotfiles --work-tree=$HOME`.

    And then set status.showUntrackedFiles to no.

    See: https://github.com/sp1ritCS/dotfiles

    I've got this idea from the following blogpost: https://news.opensuse.org/2020/03/27/Manage-dotfiles-with-Gi...

  • dotfiles

    Mostly ~/.* files to configure vim, sh, tmux, etc. on Debian, Mac, and Windows (by susam)

    I follow a similar but handcrafted approach. I have a dotfiles repo with a setup script that automates the creation or deletion of all the symbolic links: https://github.com/susam/dotfiles/blob/master/setup

    So what I do on any new system is just:

      git clone https://github.com/susam/dotfiles.git

  • dotfiles

    Personal dotfiles (by josepmdc)

  • dotfiles

    My dotfiles and a shell script to manage them (by kevin-hanselman)

    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

  • dotbot

    A tool that bootstraps your dotfiles ⚡️

    I like dotbot [0] and have been using it for a while. How do people manage secrets, I am encrypting with keybase, but really want to move away from it.

    [0]: https://github.com/anishathalye/dotbot

  • dotfiles

    Settings for various tools I use. (by nickjj)

    Call me old fashioned but what's wrong with having a regular git repo anywhere you want with all of your dotfiles and them symlink those files to where they need to go?

    If you wanted to you could && a few symlinks and other commands into 1 copy / paste'able command to get up and running really quickly. It's also painless to manage secrets by sourcing in optional files. It also works nicely when you want files living across 2 systems (such as WSL 2 and Windows) where on a Windows box you consider certain Windows files dotfiles even though technically they exist elsewhere.

    I've been managing my dotfiles like this for a few years and it seems to be working out well not just for myself but others who have want to use them either partially or in full. I open sourced them here: https://github.com/nickjj/dotfiles

    I purposely broke up some of the commands because I know that not everyone will want a 100% replica of my dotfiles. Folks copy / paste only the commands they want.

  • GNU Stow

    GNU Stow - mirror of savannah git repository occasionally with more bleeding-edge branches

    Too bad that's broken for directory names: https://github.com/aspiers/stow/issues/33

  • bashrcd

    .bashrc organizer with helpers

    I moved to splitting my bashrc into multiple files and having my main bashrc source them from a ~/.bashrcd directory.

    At heart it's a short snippet that just checks for existence and sources each file in the directory:

    https://github.com/targaryen/bashrcd/blob/master/install/ins...

    I added aliases to list/edit/remove entries from the .bashrcd directory and resource it. And a script I can call with a one-liner to edit bashrc on a new machine to add the sourcing and the helper aliases.

    It'll load alphabetically so I can prefix entries with a number to specify load order (defaulting to 0100 so I don't need to specify this in the commands unless I explicitly changed them).

    So the end result is that I can quickly edit or create a new bashrc entry by running 'ebrc entryname'. This opens ~/.bashrcd/0100--entryname in vi, and when it's saved it'll re-source so the add/change takes effect immediately.

    Or 'lbrc' to list contents of the directory, or 'rbrc entryname' to remove ~/.bashrcd/0100--entryname

    It's fairly simplistic but takes away most of the cognitive load of managing a complex bashrc.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts