News for hackers. Stuff that matters.
Re:Ask HN: How do you sync your computer’s development confi... by bloopernova on Thursday May 26, 2022 @09:25AM (#31518053)
Basically I use git for .local/dotfiles/ which are then symlinked to the relevant files like .zshrc or .emacs.d/init.el. Then I just keep that repo up to date with git pulls. Works across 2 macbooks, a Fedora workstation, and a Fedora headless server.

Couple of bits from a guide I wrote recently: https://gist.github.com/aclarknexient/0ffcb98aa262c585c49d4b...

    # store stuff here that you don't want in github
    [[ -f $HOME/.zshenv-local ]] && source $HOME/.zshenv-local

    # depends on 'brew install grep'
    [[ $OSTYPE =~ ^darwin.* ]] && alias grep='ggrep --colour=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}'
That OSTYPE is great for all those little bits that are unique to each operating system. The zshenv-local is in .gitignore, so you can keep tokens, api keys, etc etc in there. OSTYPE could even be used to import specific files like .zshenv-darwin or .zshenv-linux-gnu

If you're ssh'ing between your hosts, you can use something like this:

    if [[ -n $SSH_CONNECTION ]]; then
      ZSH_THEME="afowler"
    else
      ZSH_THEME="powerlevel10k/powerlevel10k"
    fi
It's not fancy and doesn't use cool tools, but my setup works for me just fine.
Re:Ask HN: How do you sync your computer’s development confi... by duffyjp on Thursday May 26, 2022 @09:49AM (#31518292)
I do something similar, but even simpler. I have my entire home dir as a git repo, but my .gitignore contains a single "*". I git add files I want with a -f.

I'm gonna go though your guide later though-- I like quite a bit of what I've skimmed so far. Thanks for posting that.

Re:Ask HN: How do you sync your computer’s development confi... by bloopernova on Thursday May 26, 2022 @09:56AM (#31518382)
Any feedback on the guide will be gratefully received. I'm trying to write better docs to give a little back to the open source community - it's not much but it's what I can manage :)

EDIT: and that "*" for gitignore is intriguing, I'll have to take a better look at that whitelist vs blacklist setup, thank you!

Re:Ask HN: How do you sync your computer’s development confi... by ScottEvtuch on Thursday May 26, 2022 @11:46AM (#31519778)
I've been doing "home dir is a repo" for a while now too and I'm always surprised when people think it's weird/dangerous. I wrote a few guides with tricks on how to do it on my blog that all started with "This is probably a horrible idea but here's how to do it anyway!"
Re:Ask HN: How do you sync your computer’s development confi... by glmdev on Thursday May 26, 2022 @05:17PM (#31523470)
I keep a .dotfiles git-repo similarly. The configs/custom scripts/etc are organized into separate folders by what they do (shell config/work tools/...) and I use GNU Stow to symlink them into my home directory. Makes setting up super easy:

    git clone <repo> .dotfiles && cd .dotfiles
    stow --target=$HOME --dir=packages shell-config
    stow --target=$HOME --dir=packages work-stuff
I've found this to be much more manageable than tools like yadm since I can pick-and-choose sets of configs/scripts based on the machine I'm using them on.
Re:Ask HN: How do you sync your computer’s development confi... by vlunkr on Thursday May 26, 2022 @11:45AM (#31519766)
This is what I've done for a long time. You get the benefits of keeping things synced and having a full history.
Re:Ask HN: How do you sync your computer’s development confi... by intrepidhero on Thursday May 26, 2022 @09:52AM (#31518332)
I did the same plus just a little bit of Ansible makes deployment a little nicer.
Re:Ask HN: How do you sync your computer’s development confi... by bloopernova on Friday May 27, 2022 @06:18AM (#31527893)
I looked into Ansible after reading your comment - I've only ever used it and Puppet for larger-scale stuff so hadn't even thought of using it as a localhost-only playbook. This looks like it could manage my symlinks for me very nicely :) Thank you!