News for hackers. Stuff that matters.
Re:Better Dotfiles by dharbin on Friday September 06, 2024 @02:55PM (#41468768)
I’m a big fan of chezmoi (https://www.chezmoi.io/) which is a very capable dotfile manager. Chezmoi supports some useful advanced capabilities like work/home profiles and secrets manager integration.
Re:Better Dotfiles by kstrauser on Friday September 06, 2024 @03:10PM (#41468871)
Same for me. I'd done the same thing as the author with various methods like stow, symlink farms, etc. over the years. Chezmoi is good enough that I'm willing to let someone else handle maintaining all logic.
Re:Better Dotfiles by dngray on Friday September 06, 2024 @06:40PM (#41470216)
Yup, I tried a number of dotfile managers. I think yadm was the first one I started with and then ended up with chezmoi.

The main reason was because I discovered the power of templating. With Yadm it required an external dependency, envptl, then j2cli, and both of these became unmaintained, while chezmoi used the text/template standard library. After the task of converting my jinja2 templates to gotmpl I never looked back.

One of the other things I like about chezmoi is I significantly cut down any "scripts" to just a few as most of the logic became "deterministic", ie I would set conditions based on the host in chezmoi.toml.tmpl and then that would define how everything under that would run across multiple hosts, and devices.

Re:Better Dotfiles by ashconnor on Friday September 06, 2024 @03:23PM (#41468957)
I migrated to chezmoi recently my only gripe is `chezmoi cd` opening in a new shell but `chezmoi git` usually is what I need. The age [0] integration is nice.

[0] - https://github.com/FiloSottile/age

Re:Better Dotfiles by baliex on Friday September 06, 2024 @05:51PM (#41469989)
I added an alias `cm='cd $(chezmoi source-path)'` to my shell config to cd to the chezmoi directory (without opening a new shell) so I can use all the usual commands (e.g. git) without need the chezmoi prefix. The alias is in a chezmoi-managed file, naturally.
Re:Better Dotfiles by twp on Saturday September 07, 2024 @09:26AM (#41473828)
Unfortunately there's no other way of doing this, except for adding a shell alias. See https://www.chezmoi.io/user-guide/frequently-asked-questions....
Re:Better Dotfiles by ashconnor on Sunday September 08, 2024 @12:39AM (#41478239)
Makes sense. Thank you for the project.
Re:Better Dotfiles by Barrin92 on Friday September 06, 2024 @03:45PM (#41469140)
also a big fan of it because the templating feature makes it very easy to handle dotfiles with different locations on multiple machines and if you use multiple operating systems. Really not that many tools around that have good windows support.
Re:Better Dotfiles by samgranieri on Saturday September 07, 2024 @11:41AM (#41474514)
Chezmoi is amazing. I dabbled with Stow, but Chezmoi is the way to go.
Re:Better Dotfiles by wyclif on Sunday September 08, 2024 @06:14AM (#41479470)
Hey, I had never heard about chezmoi before reading your comment, but I just installed it. Took less than 10 minutes to set up from start to finish. I noticed that if you choose to use it to manage your `~/.ssh/config/`, by default chezmoi sets it up as `private_dot_ssh/` and so if your dotfiles are public it doesn't expose sensitive data like private key files such as `~/.ssh/id_rsa`. Smart!
Re:Better Dotfiles by Arrowmaster on Sunday September 08, 2024 @09:10PM (#41484650)
The private_ only applies to file permissions so in this case it makes the .ssh directory only readable by the owner. This is checked for by openssh and the config will be ignored if it's readable by the group or all.

If you make your dotfiles repo publicly accessible, you will leak your private keys unless you use other features in chezmoi to protect them.