Live data from Hacker News

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

news.ycombinator.com

61–70 of 153 posts

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

#63
I record everything that I do, for initial setup or otherwise, in a large text file and/or cloud document holding blocks of shell instructions like:

  # set up stuff
  (
    VAR=
    curl 
     "$VAR"
    brew install  # or apt-get install 
    # ...
  )
I write them so I can paste them into the shell at any time and keep my environment updated declaratively, without having to think. This way I never store any local state, not even command aliases. Otherwise I start getting attached to my setup, which leads to anxiety.

It's good practice to check out a project repo periodically and see what it takes to get running inside a fresh OS or user. It's handy to do while onboarding new developers too. Sometimes I'll even put these setup instructions at the top of the project repo's readme itself, so it doesn't have a dependency on anything external.

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

#64
post #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 c…

Additional benefit is that defaults are often such that they work well together, often in ways that you might not have foreseen beforehand and thus never would have set up yourself.

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

#65
post #42

I use Nix to manage: - a desktop running NixOS (primary work machine) - a Macbook (secondary/travel work machine) - a Linux VM on WSL - two servers (a raspberrypi in my closet and a Hetzner vps) I keep my config on Github (latest branch https://github.com/alexghr/nix/tree/host/vader ). I'm still new to this so a lot of my config is duplicated across different hosts but I want to refactor it to eliminate duplication.…

It's crazy how good nixos+git gets when you've iterated for a while. I'm using the same setup on my work laptop, my home PC, and my router.

Coming up on my 1 year anniversary with NixOS and couldn't be happier, even though it has taken quite some time to adjust to (and I still barely know the language).

Having one place for all configurations is such a breath of fresh air, and having my work & home PC being identical (even Gnome is declaraticely configured!) is so nice.

Before NixOS, I resented using my private PC because it was never up to date with what I had configured on my work PC, but now that's just a "git pull && nixos-revuild switch --flake ." away - regardless of what has changed.

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

#66
Just use vscode and remotes. Zero hassle and zero friction - just fire up and start coding. It is seamless.

I use it on windows, Debian, macos and even Chromebooks and don't have to worry about any kind of syncing. It just works

It has a built in settings sync thing, but as a general rule I strongly strongly avoid the use custom settings (in anything) to avoid the issue you are facing. There is in my experience a huge productivity gain to be had by just being pragmatic and using (and knowing) defaults in everything you use frequently, and not being a useless prima dona if your custom key bindings are missing from every single machine you need to use each day/week/month/year. We jump around servers and computers frequently, so I find it is easiest and most productive to just go with the flow and use the defaults so I can be working immediately as soon as I SSH into a new host or am given a new laptop to use for a 3 week long contract or whatever.

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

#67

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 $HO…

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 configurations/environment?

#68
post #28

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 $HO…

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.

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 configurations/environment?

#70
post #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 c…

I think there's a healthy middle ground here. Endless tweaking of settings tends to be a waste of time, but if you spend hours a day on a computer, you might as well make it comfortable. Some people use no $EDITOR plugins and wear it like a badge of honor, this is pretty silly to me. The few minutes it takes to install and learn about a plugin might save you hundreds on hours in the future.

I guess my personal strategy is to run with the defaults until you find the pain points, and install/configure something to address them. And put them in git repo if possible.

Post reply on HN