Live data from Hacker News

Yadm: Yet Another Dotfiles Manager

github.com

21–25 of 25 posts

Re: Yadm: Yet Another Dotfiles Manager

#21
post #6
post #4

Earlier quoted context omitted.

Yes, it does. https://yadm.io/docs/alternates# I used yadm for a while. I switched to Chezmoi ( https://www.chezmoi.io ) though. Same ideas, but much better execution IMO.

I'm surprised by this because I find the chezmoi workflow very annoying, to the extent that I wrote my own thing (see my other comment). Where did you find yadm fall short?

The workflow that you show in your repository is really not that different from Chezmoi. If you configure a post-add hook in Chezmoi (https://www.chezmoi.io/reference/configuration-file/hooks/), you can do `chezmoi add ~/.config/whatever/whatever.conf` and have the file auto-added to the Chezomi git repo + push it to some remote if you'd like.

yadm made it difficult for me to take specific actions when a file changed. For example, I configure a lot of macOS settings in my dotfiles (https://github.com/cweagans/dotfiles/tree/main/dot_config/ma...). When any of the JSONC files change, I need to run a script to actually apply them (https://github.com/cweagans/dotfiles/blob/main/.chezmoiscrip...), but I don't want to do that unconditionally. Chezmoi tracks that state for me and only runs the script when needed. Ditto with the macOS config profile (https://github.com/cweagans/dotfiles/blob/main/dot_config/ma... and https://github.com/cweagans/dotfiles/blob/main/.chezmoiscrip... respectively).

I was also not thrilled about the idea of shipping an encrypted blob of important secrets around. I want my dotfiles to be public, so it's much nicer when the tool I use for managing my dotfiles natively integrates with 1password. Much of the templating functionality that I use from chezmoi is specifically for pulling stuff out of 1password.

Finally, the yadm "alternate files" functionality is nice, but I didn't really care about alternates for different OSes or hostnames or whatever. I wanted some configuration for my work machine(s) and some configuration for my personal machine(s) - that's it. That's the only distinction I care about. Chezmoi made it easy to prompt for the type of machine + change the things that get configured accordingly when bootstrapping a new machine (https://github.com/cweagans/dotfiles/blob/main/.chezmoi.toml...).

Re: Yadm: Yet Another Dotfiles Manager

#22
I am very difficult to please when it comes to dotfile managers. I tried all of them and I'm quite fond of rcm[0]. It's been a few years so it's hard for me to remember exactly what it was but I think both chezmoi and yadm involved some kind of step to "apply" changes but I just want things symlinked into a dotfiles repo that I have a cron job which basically does `git ci -a && git push` to synchronize changes.

That said, I don't think rcm should be anyone's first choice. I'd check it out if nothing else seems to work for you. From what I hear, chezmoi seems to be most people's favorite so I'd start there. I don't know a single other person that uses rcm.

[0] https://thoughtbot.github.io/rcm/rcm.7.html

Re: Yadm: Yet Another Dotfiles Manager

#23
post #2

Transitioned from gnu stow to nix/home-manager and haven't looked back. The great part about that setup is my configuration contains not just my dotfiles, but also the installation of the programs themselves. I don't use the "nix" way of configuration though, I instead have home manager symlink everthing for me. Then I can bail on nix anytime and not have to translate all my files back to yaml. Glad programs like the…

I did almost the same, but I am converting things as slowly/lazily as possible.

One thing that helped me tremendously migrating the configuration bits was to leave "scratchpads" that I could tweak quickly without a full rebuild cycle:

  programs.kitty.extraConfig = ''
    include ${config.xdg.configHome}/kitty/temporary.conf
  '';
Then my ~/.config/kitty looks like this:

  ~/.config/kitty $> ls
   87 Dec 13 11:39 kitty.conf -> /nix/store/....-home-manager-files/.config/kitty/kitty.conf
  381 Dec 13 11:42 temporary.conf

Re: Yadm: Yet Another Dotfiles Manager

#24
post #4
post #3

Does this program allow linking the same file to different locations on MacOS vs Linux? I have a few config files like the vscode settings.json that end up in different paths but have the same content. (I see it allows for files that are OS specific but not clear if there is a way to keep them in sync if they are the same, but just need different paths) I use stow at the moment and it is almost perfect but I don't be…

Yes, it does. https://yadm.io/docs/alternates# I used yadm for a while. I switched to Chezmoi ( https://www.chezmoi.io ) though. Same ideas, but much better execution IMO.

Did chezmoi make it easy to edit and then add fileswith changes?i hated always having to chezmoi this and that rather than doing what i want then runn*ng yadm -u to pick up all the changes in my tracked files

Re: Yadm: Yet Another Dotfiles Manager

#25
post #4

Earlier quoted context omitted.

Yes, it does. https://yadm.io/docs/alternates# I used yadm for a while. I switched to Chezmoi ( https://www.chezmoi.io ) though. Same ideas, but much better execution IMO.

Did chezmoi make it easy to edit and then add fileswith changes?i hated always having to chezmoi this and that rather than doing what i want then runn*ng yadm -u to pick up all the changes in my tracked files

Pretty sure there are a couple of aliases that you could create to get you the workflow you want. I just edit my files on disk, chezmoi add file, then periodically fit commit and push them. You could create a post add hook to automatically git add/commit/push + I’m reasonably sure there’s a chezmoi command to list all tracked files, so you could iterate through all of them and do whatever you want with them.
Post reply on HN