1. 17

  2. 3

    This looks a bit overengineered to me, I solely rely on GNU make, patch and git² to install and update my dotfiles and don’t miss anything. Ok, I have to admit that I don’t synchronize secrets since I keep them in keepass containers and only use the dotfiles between various Linux distributions¹. Also, I don’t think that I want to mix secrets with my dotfile environment.

    ¹ My simple solution should work on BSDs too.

    ² I expect vim and docker to be present, but the latter one is only required if you want to preview the environment. Update: I forgot to mention that I also require Rust at the moment since my shell prompt is generated from a small Rust application. This has the advantage that I don’t have to care what the escape sequences for different shell prompts are. This dependency could be removed by cross-compiling binaries for rusty-prompt.

    Edit: Add second footnote.

    1. 2

      I know how you feel but it does seem to add a lot of value.

      For instance - the templating feature. I tried using Homesick for years but eventually gave up on it because I had dot files in different locations evolving in different ways.

    2. 1

      Any reason to use this if I’m already comfortable with Gnu stow?

      1. 2

        From the README -

        If your system is based on copying files with a shell script or creating symlinks (e.g. using GNU Stow) then handling files that vary from machine to machine requires manual work. You might need to maintain separate config files for separate machines, or run different commands on different machines. chezmoi gives you a single command that works on every machine.

        1. 1

          That kind of seems like a layer of unneeded complexity.

          I just have my machines create a .local copy of a file that sym links based off the hostname, which is then imported. So for vim it would create a symlink like the following:

          [ -f "~/.vim/env/${hostname}"] &&  ln -s "~/.vim/env/${hostname}" "~/.vim.local"

          I also have something similar for the env type I’m on (e.g. on osx always add the homebrew dir to the class path if it exist).

          1. 1

            I basically do this by ‘layering’ in stow. I have a ‘shared’ directory with configs that are consistent across all devices, then a separate device directory (named after hostname) with any device-specific configs. I just call stow twice, once on the ‘shared’ dir then again on the appropriate device-specific dir.

        2. 1

          For those interested in that type of tool, I made a pure-shell tool with similar high level goals (but fewer features) here https://github.com/sebastien/dotenv. But I think chezmoi is probably better ;)

          1. 1

            chezmoi was inspired by Puppet

            And it shows. I use Puppet for my dotfiles, and it looks like chezmoi covers basically everything I use from Puppet. I do use hiera layers, but the flattened data is still so small it hardly matters.

            Awesome project!

            1. 1

              chezmoi looks great – thank you. What are the benefits of using chezmoi over something like ansible?