5 ms·
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 w
by bloopernova 4y ago
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/0ffcb98aa262c585c49d4b3f3ae24019 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.
- duffyjp 4y agoI 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.
- bloopernova 4y agoAny 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!
- ScottEvtuch 4y agoI'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!"
- intrepidhero 4y agoI did the same plus just a little bit of Ansible makes deployment a little nicer.
- bloopernova 4y agoI 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!
- vlunkr 4y agoThis is what I've done for a long time. You get the benefits of keeping things synced and having a full history.
- glmdev 4y agoI 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.