https://karnwong.me/posts/rss.xml

Multi-machine work setup

2025-09-11

I have three machines that I use regularly: linux desktop, linux laptop and a macbook. The reason is because the pc is my desk setup, laptop for bedroom, and macbook for when I go out. Having these machines share the same state(ish) would be ideal because the machine switch should be as seamless as possible. I've been rocking this setup for 4+ years, so it's been tested in production!

The machine states are broken down into following:

  • packages
  • configs
  • apps
  • data

For packages, I use nix for package management (which works for both linux and mac). There are some stuff I install directly via go, cargo and yarn, which is written down as part of my setup script.

Nix can be used with configurations as well. For certain configurations containing secrets, I use sops to decrypt them outside of nix, since on my system they need to exist as plaintext.

For desktop apps, thankfully flatpak works well with linux, and brew for mac.

As for data, specifically non-application data, I use syncthing to sync files between machines. I have a home server with syncthing on it, but you can host it on a VPS as well.

For desktop application data, I start with a single machine, setup all applications, then use restic for backup. On another machine, use restic to restore. Although this setup means you can't share the backups between linux and mac.

It probably sounds like a lot of work, but once you set it up you barely have to think about it. If I were to get a brand new machine and have to set it up so I can use it for work, I can do it in 30 minutes with the workflow outlined above.

If you only use a single machine, it's probably overkill, but it'll be very useful when you have to setup a new machine. Then again, I'm an ops person, I sleep soundly when I know what my exact configurations are 😪.