Ask HN: Why hasn't config as code taken off for developer machines

11 points by yourabstraction ↗ HN
Configuration as code has been a huge success for managing cloud servers, so I'm wondering why we haven't seen it take off for developer machines. Everywhere I've worked the first few days has been a nightmare of following out of date docs, hitting version conflicts with tools, lots of googling and time wasted. Why isn't there a better way to manage all this? I've worked at large and small companies, and never have had a smooth experience.

11 comments

[ 4.1 ms ] story [ 41.6 ms ] thread
(comment deleted)
It's been pretty smooth the two places I've worked. Both have used a virtual machine setup with config that's partly shared with production, so there's incentive to make sure things are up to date.
A VM/container setup is the way to go, with as much as possible shared from prod setup processes.

Specifically, it should be very automated and repeatable to bring up an environment, either from the last working state (i.e. to boot the vm) but also to bring up a fresh environment - potentially following a teardown/destroy.

I quite like Vagrant for this - it's multi platform, works across multiple providers (i.e. you might use HyperV on Windows, Joe might use VBox on Mac, Bob might use VMWare on Linux, Sally might use LXC on Linux) and has quite a healthy range of plugins to extend functionality.

There is no better boost to productivity when starting at a new place than having a working dev environment in VMs or containers. Bonus points if it comes with sensible config defaults and can be started with a single command.

This is one of those things that immediately pays dividends as soon as more than one person works on a codebase. No need for everyone to rediscover independently how to get a complex app running locally.

Do you find that working in VMs or containers hampers developer productivity once you're up and running?
Not if you can provide a good developer experience with live reloading, a debugger, a way to run the test suite etc.
Currently there's a large community forming around NixOS, which might be what you're looking for. That said NixOS still seems to have some rough edges so most people seem to prefer traditional distributions like Debian or Ubuntu.
NixOS seems interesting, but I keep hearing about the steep learning curve, and I also prefer to work on macOS, so I haven't delved into it yet. It does seem like it's worth checking out though. I wish there was a way to get some of that deterministic setup in macOS.
Nix (the package manager) works great in MacOS, if thats what you meant. You don't have to install NixOS to get great benefits.

The documentation itself is good, I feel, but as a newcomer it's really hard to know where to look. But it's getting better, by strides.