News for hackers. Stuff that matters.
Re:Chezmoi – Manage your dotfiles across multiple diverse ma... by rovr138 on Monday August 29, 2022 @09:12AM (#32637775)
2 weeks ago someone asked

> Ask HN: Can I see your scripts?[1]

I really like this[2] solution from /u/hoechst,

> Not really a script, but a `.ssh/config` to automatically deploy parts of my local cli environment to every server i connect to (if username and ip/hostname matches my rules).

> On first connect to a server, this sync all the dotfiles i want to a remote host and on subsequent connects, it updates the dotfiles.

> Idk if this is "special", but I haven't seen anyone else do this really and it beats for example ansible playbooks by being dead simple.

    Match Host 192.168.123.*,another-example.org,*.example.com User myusername,myotherusername
       ForwardAgent yes
       PermitLocalCommand yes
       LocalCommand rsync -L --exclude .netrwhist --exclude .git --exclude .config/iterm2/AppSupport/ --exclude .vim/bundle/youcompleteme/ -vRrlptze "ssh -o PermitLocalCommand=no" %d/./.screenrc %d/./.gitignore %d/./.bash_profile %d/./.ssh/git_ed25519.pub %d/./.ssh/authorized_keys %d/./.vimrc %d/./.zshrc %d/./.config/iterm2/ %d/./.vim/ %d/./bin/ %d/./.bash/ %r@%n:/home/%r

[1] https://news.ycombinator.com/item?id=32467957

[2] https://news.ycombinator.com/item?id=32468605

Re:Chezmoi – Manage your dotfiles across multiple diverse ma... by folkrav on Monday August 29, 2022 @11:03AM (#32639149)
I could see both being really useful. I don't want my full dotfiles available on arbitrary remote servers. But being able to setup a new dev environment by just cloning my dotfiles and linking them back is also invaluable.
Re:Chezmoi – Manage your dotfiles across multiple diverse ma... by rovr138 on Monday August 29, 2022 @01:18PM (#32640816)
Exactly.

I don't think that deploying all my dotfiles to a remote server is smart. But there are a few things that could be deployed that would help with quality of life.

I think this is a great way of doing that.