Hacker News new | past | comments | ask | show | jobs | submit login

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 believe it can do that without multiple symlinks or something messy. Didn't like home manager and other dotfiles solutions seemed too bloated for my case




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...).


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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: