Live data from Hacker News

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

news.ycombinator.com

31–40 of 153 posts

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

#31
I used to use a git repo of dotfiles which used a script to symlink into $HOME: https://github.com/RyanGibb/dotfiles

But there were a few problems with it: - installed packages needed to be managed separately (the mechanisms for which varied by platform) - managing differing configs for different machines (e.g. headless servers, hardware quirks) was done by managing different branches of this repo and rebasing, which was a pain - it was generally brittle and hard to change

I've started to use https://nixos.org/ and it's been like night and day: https://github.com/RyanGibb/nixos/

My config is version controlled, reproducible, manages packages, and is very composable.

Using the nix package manager and https://github.com/nix-community/home-manager this should work on other Linux distributions, MacOS, and even Windows Subsystem for Linux. Although I haven't tried this for myself yet.

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

#32
Personally I'm in Emacs for almost anything so different environments are just different set of org-mode files with things to tangle, different org attach and roam directories etc, common staff sync-ed with unison.

That's work VERY well, but might not fit your needs depending on what you need to use for work...

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

#33

Dotfiles in my home directory go in a repo that gets cloned and "installed" (I use a shell script that I wrote to make all the symlinks, but GNU Stow is probably better better). System level configuration and package installation is handled by ansible, with a certain amount of stuff controlled by conditional statements based on the distro and host name of the machine to allow arbitrarily local overrides. All that sai…

Stow requires LaTex support to build from source. I tweaked it[0] to make sure it builds without it.

[0] https://github.com/jvsg/stow-simple

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

#34

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

#35
the main question here is, do you really need to change the settings once you have a baseline?

I'm another one using a private GitHub repo for this. But I don't need to pull, update, sync or whatsoever. I've been using the same config for years, and in the eventual case that I would change / add something, I can do that quickly in a few computers, no need to have any sort of sync.

For VSCode settings I just use the built-in service.

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

#36
Like a few others here, I use git with a .dotfiles directory, which uses an install script that creates symblinks (among other things). It's grown a lot of over the years (maybe decade now?) and I've been meaning to look into using something like GNU Stow, but haven't got around to it.

The install script and configuration works on macOS and Linux, but sometimes requires updating when running on a new machine (like recently when provisioning a new M1 Max MacBook Pro). At one point I had it installing default packages (particularly a lot of stuff from Homebrew), but ultimately moved away from that because I realized it just kept too much old unused cruft hanging around.

I also have my configuration files setup so that it can be used for work or personal machine. For example, my .gitconfig includes another config when in the ~/work directory:

    [includeIf "gitdir:~/work/"]
      # work-specific settings (override email, etc.)
      path = ~/work/.gitconfig.inc
https://github.com/sethdeckard/dotfiles

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

#37
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.

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

#39
You say you also have a windows machine, but if you were to use only linux then I would seriously consider using nixos. I have three desktops and one macbook pro (2015) all of which run off of the same configuration.nix and the home-manager nix package. Using this on a new machine I'm up and running in about an hour.

Configuration changes are committed and pushed, and whenever changing machines a `git pull && nixos-rebuild switch` would bring the current one up to date.

Things that are automated: installed packages, systemd services, mounts, users and user groups, networking (including VPNs, /etc/hosts), users' environments, users' home folder content (dot files, random useful bash scripts put in PATH, etc), emacs packages.

A few manual steps still remain (adding keys, cloning repos, some desktop environment tweaks) - undone mostly out of laziness to figure them out.

Of course, one has to learn nixos to use this, and that, quite frankly, has been quite pain :). Though, once you get a hang of it, it relieves a huge painpoint: you are no longer mentally attached to any single physical computer.

Would recommend.

Post reply on HN