5 ms·
Ask HN: Dotfiles Management Tools?
My customized shell script isn't as robust as it should be and I don't want to reinvent an inferior version of what must surely already exist.
What tools would you recommend for managing dotfiles that are robust, doesn't have external dependencies, uses git and are idempotent?
I'd like something that manages directories of files (e.g. ~/.vim/ftplugin/) in sub-directories, as well as in $HOME. If the tool can deal with multiple systems (MacOS, CentOS, debian) then even better!
Thanks!
- jmercouris 5y agoGnu Stow is something I've often heard referenced. Disclaimer: I have no experience using it.
- andrewrothman 5y agoI've been using GNU Stow (with Git) for the past month to sync some of my dotfiles between two laptops (Mac and Linux). It took 10 minutes to get comfortable with it and it works well for me.
- FrenchyJiby 5y ago+1 For stow ("a symlink farm manager") Simple usecase: cd ~ mkdir -p dotfiles && cd dotfiles mkdir -p bash && cd bash touch .bashrc cd ~ stow bash # Deploys ~/.bashrc symlinked from ~/dotfiles/bash/ # More packages, version control: cd ~/dotfiles git init && git commit -am "Initial commit" mkdir -p ~/dotfiles/git/ touch ~/dotfiles/git/.gitconfig # deploy git package cd ~ && stow git # revert bash "package deployment" stow -D bash I've gone a bit overboard myself (many packages, litterate programming declaration of emacs config, Vagrant VM with Ansible deployment etc), see https://github.com/OverkillGuy/jibyconf https://github.com/OverkillGuy/jibyconf
- mgradowski 5y agoI use GNU Stow with a dotfiles git repo placed in $HOME. Works well.
- mthwsjc_ 5y agochezmoi [1] looks like a tool for power-users. I'll give it a try and see how it goes. It seems to be more capable (and more complex) than dotbot [2] [1] https://github.com/twpayne/chezmoi https://github.com/twpayne/chezmoi [2] https://github.com/anishathalye/dotbot#plugins https://github.com/anishathalye/dotbot#plugins
- knoebber 5y agoArch wiki has a nice list: https://wiki.archlinux.org/index.php/Dotfiles#Tools https://wiki.archlinux.org/index.php/Dotfiles#Tools I made a dotfile management tool: https://github.com/knoebber/dotfile https://github.com/knoebber/dotfile , but it's not based on git or designed for directories of files. I think Chezmoi would fit your usecase well: https://www.chezmoi.io/ https://www.chezmoi.io/
- markemer 5y agoI’ve been using Chezmoi for a while now, I rather like it.
- seniorivn 5y agohttps://github.com/nix-community/home-manager https://github.com/nix-community/home-manager is much more than that, but it can be easily used as a basic dotfiles manager the way you described it
- zests 5y agoHere's a guide using a git bare repository: https://www.atlassian.com/git/tutorials/dotfiles https://www.atlassian.com/git/tutorials/dotfiles
- notJim 5y agoI've been using this (lightly) for a couple years, and I've been happy with it.
- happyrock 5y agoMe too. It's good enough.
- iib 5y agoI try to use Drew DeVault's method [1], which is similar, but it seems much more straightforward. It uses a regular git repository in $HOME, a .gitignore file that is just a `*` so that it ignores all files and you have to force add the files that you want. As a disclaimer I have to say I have never migrated my system to another one or even shared my config, so unforeseen problems may appear. [1] https://drewdevault.com/2019/12/30/dotfiles.html https://drewdevault.com/2019/12/30/dotfiles.html
- wjertyj 5y agoI use this method as well, but instead of force adding files, I use an inverted .gitinore. * !/.bashrc !/.config/ !/.config/monitors.xml This lets me quickly quickly detect changes in my working dir while still explicitly adding each tracked file.
- ISO-morphism 5y agoThe one issue I've had with this is that ripgrep will use the gitignore so without an extra option most any search in any folder under $HOME will turn up empty
- vulcan01 5y agoAlthough I just use git (with symlinks from ~/.dotfiles to wherever the software is actually expecting the config), most people I know use https://yadm.io https://yadm.io instead.
- epakai 5y agoI use yadm (https://yadm.io/ https://yadm.io/), and like it for dealing with multiple systems because of it's alternates system (https://yadm.io/docs/alternates# https://yadm.io/docs/alternates#). It's git based, and works on various systems (your list is covered). edit: Note if you're on Debian stable, the current package is 1.x. At this point testing has moved on to 3.x. It's probably worth going straight to 3.x to avoid reworking alternates and dealing with other changes. The testing/unstable package is easy to backport (look up simple sid backport).
- qq4 5y agoCan't get much simpler than git and stow
- genpfault 5y agoHardmode: INI canonicalization + some sort of per-section/key .gitignore for 'noisy' or machine-specific data.
- TheLocehiliosan 5y agoI’m biased, but would recommend trying yadm. https://yadm.io https://yadm.io I specifically have a design goal of very little external dependency. It only requires Git and Bash be present, so it is quite portable. Many people even use it on some network equipment. You can simply download the script if it isn’t packaged somewhere. It can easily handle directories of files, but also submodules. Many people add vim plugin Git repos directly as submodules. If you are familiar with Git, you’ll find yadm extremely easy to use. When you need them, more features are there to solve specific problems, like bootstrapping operations, encrypting private data, templating, or system dependent alternate files. On a new system you can quickly bootstrap your existing dotfiles repo using https://bootstrap.yadm.io https://bootstrap.yadm.io, without yadm installed yet. This is mostly useful if you’ve included yadm directly in you dotfiles (directly, or as a submodule, or as some installation during bootstrap).