Live data from Hacker News

Ask HN: How do you sync your computer’s development configurations/environment?

news.ycombinator.com

1–10 of 153 posts

Ask HN: How do you sync your computer’s development configurations/environment?

#1
I have two personal computers and one work laptop, all of which have similar development environment but not the same. One personal computer runs windows, the other two Ubuntu.

Since I knew that I will be using different IDEs and environments, I decided to learn vim and use vim bindings in all my IDEs to ensure some sort of similarity across all my development environments, but it doesn't cover it all. I've also tried manually migrating my home directory between different computers, but that comes with several issues, primarily that I'd have to try to share it between professional and personal computers. So what I'm left with is basically remembering what I'm using, and then tediously spend a day or more re-configuring newly installed computers with the software and configurations I know I'm using. It feels like I have to throw away my perfectly configured hammer which I know by heart and get a new one every time I work at a different workplace instead of bringing it along and perfecting it further. Surely there's a better way.

How do you keep your development environments/ways of working synced and backed up?

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#2
Yeah, mixed environments are really tough. Though (most) of my machines are Linux, they often have _some_ stuff that should be the same and _some_ stuff that should not. My solution has been to use the fine-grained GNU Stow approach, which allows me to apply only the bits I need for a particular machine.

The files you're managing don't even need to be text, though, of course, it makes versioning, etc. a lot easier.

I also check the host name in some of the scripts to modify behavior depending on the machine.

I did a write-up about my whole setup (emphasis on GNU Stow + Git) here:

https://ratfactor.com/setup2

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#3
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 Digitalocean droplet and try to configure my system from scratch using the dotfiles.

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#4

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.

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#5
I wrote a utility for this problem. I had 3 computers -- Linux with HiDPI, Linux with a normal DPI, and Mac. They all used the same dotfiles with slight differences. It was impossible to keep them in sync. I created a super simple template utility designed for working with dotfiles.

https://github.com/kesslern/dot-templater

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#6

Yeah, mixed environments are really tough. Though (most) of my machines are Linux, they often have _some_ stuff that should be the same and _some_ stuff that should not. My solution has been to use the fine-grained GNU Stow approach, which allows me to apply only the bits I need for a particular machine. The files you're managing don't even need to be text, though, of course, it makes versioning, etc. a lot easier. I…

I also use GNU Stow + Git and has worked well for me. For files I want to sync that I don't need versioning for and it is important that I have them available even in cases where I may have forgotten to commit my changes on some individual machine, I use Syncthing[1], which is really great for the more Dropbox-y kind of cross-machine sync that I also have a need for.

[1]: https://syncthing.net/

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#9
Not 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 course, there are still a few things I change from the defaults. But since there are so few I can just configure them by hand, because how often am I setting up a new computer? Not very often. And there are so few config changes, it only takes a minute.

The only thing I have to actually sync is my vim config. It's a very small config, but it's still more than nothing. I just store it in a Git repository.

Re: Ask HN: How do you sync your computer’s development configurations/environment?

#10
It's probably awful but I sorta really just rely on system backups for my configs. Download and restore anything I'm missing from the latest backup when I reinstall the system.

I do keep my ~/scripts/ directory in a git repo (also this directory is in my $PATH) because they're all very hack and slash "I need to do a thing repeatedly, quickly" scripts. Sometimes I might want to go back a step or two when I really break everything. This repo auto pulls/commitpushes every now and then as this one is more useful to be up to date on all machines than to have useful commit messages

As for live syncing devices I do have unison running on my laptop frequently to sync (when its on) a few directories I might need offline. Mostly everything I need as a dev is in git repos though, so I use manual git push/pulls to sync everything else

I did previously use mackup (https://github.com/lra/mackup) to sync configs but if I'm honest I forgot I had it set up the last time I reinstalled so it got removed from the process unintentionally

Post reply on HN