I just have a dotfiles repository and in it an installation script, one for Mac and one for Linux. Might be bad of me, but I definitely share it between professional and personal - it's just dotfiles after all. The biggest difficulty is making sure that the installation script actually matches what you want to happen because it is difficult to test on already finished system. so every so often I spin up a Digitalocea…
There’s a neat tool - stow - which handles dotfiles style installs with soft links quite handily. Absolutely worth investigating.
Ask HN: How do you sync your computer’s development configurations/environment?
11–20 of 153 posts
Re: Ask HN: How do you sync your computer’s development configurations/environment?
#12Re: Ask HN: How do you sync your computer’s development configurations/environment?
#13Couple 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-gnuIf 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 configurations/environment?
#14Then for more systemwide configuration, I have an Ansible playbook I run every now and then (configures apps, dock item order, etc): https://github.com/geerlingguy/mac-dev-playbook
Re: Ask HN: How do you sync your computer’s development configurations/environment?
#15Re: Ask HN: How do you sync your computer’s development configurations/environment?
#16Right now all my computers run fedora so there's not much difference between them but for some time I used Ansible on macOS too. It worked but was a pain to make my roles compatible for both linux and macOS.
In my experience Ansible is good when dealing with text files or if there's already a module for what you're trying to do (for example managing postgresql users). If what you're trying to do is complex enough that you need to write a custom module or plugin, it is a pain in the ass: we had to do that at work and it was terrible.
Ansible works on Windows but I have no experience with it.
Re: Ask HN: How do you sync your computer’s development configurations/environment?
#17Not just with development environments, but all computer configuration, I stick with the defaults as much as possible. Instead of changing the configuration of the computer, I change myself. For example, let's say an app has a default keyboard shortcut I don't like. I won't change it. Instead, I'll just get used to it until it becomes muscle memory. Now the default configurations are my preferred configurations. Of c…
Most configuration stuff doesn’t fit that category - or if it does, it’s best to first work on just caring about it less if possible.
Re: Ask HN: How do you sync your computer’s development configurations/environment?
#18Re: Ask HN: How do you sync your computer’s development configurations/environment?
#19Re: Ask HN: How do you sync your computer’s development configurations/environment?
#20I'm able to have the same shell with all my Vim plugins across macOS and Linux with changes committed to git. It's been so good, setting up all my command-line tooling now takes about 15 minutes from scratch.