Maintaining dotfiles with chezmoi View article history Edit article

Published:
Talks about: , and

In order to make my life easier managing lots of dotfiles with chezmoi, I’ve defined the following shell function:

function m-dotfiles-ok {
    # public
    chezmoi add ~/.zshenv
    chezmoi add ~/.config/tmuxp/ --recursive
    chezmoi add ~/.config/zsh --recursive
    chezmoi add ~/.config/mako --recursive
    chezmoi add ~/.config/sway --recursive
    chezmoi add ~/.config/tmux --recursive
    chezmoi add ~/.config/alacritty --recursive
    chezmoi add ~/.config/environment.d --recursive
    chezmoi add ~/.config/git --recursive
    chezmoi add ~/.config/systemd --recursive

    # secrets
    chezmoi add ~/.ssh/config
    chezmoi add --encrypt ~/.config/npm/npmrc
    chezmoi add --encrypt ~/.ssh/id_rsa
    chezmoi add ~/.ssh/id_rsa.pub
}

Whenever I feel happy with my current setup, I just call m-dotfiles-ok to push my changes into my local chezmoi repository. Files will automatically be encrypted with gpg and committed/pushed into a git repository.