Devenv: Compose a Developer Environment Easily for PHP with Nix

by domenkozaron 12/25/22, 7:53 PMwith 26 comments
by wackgeton 12/25/22, 10:45 PM

Honestly I've yet to be convinced of the value of having to learn to use all these extra tools which supposedly make devops "easier".

If I want a PHP environment I'd launch a VPS or virtual machine and set one up manually with a few standard shell commands. That way I'm working with the actual technologies themselves and am learning how they work directly instead of forcing myself to learn the syntax and commands of several unrelated technologies (yarn, docker, nix, etc.) which are just wrappers for the "real" setup.

These abstractions are usually far less flexible and more restrictive than just setting up the services yourself, anyway.

How is going through all of that worth the considerable extra time, effort, and mental energy than just - you know - setting up the services themselves?

A single command `yum install httpd php8 mariadb` will get you a working local server stack with very little extra configuration.

by rgoulteron 12/26/22, 2:58 AM

DevEnv looks like the most exciting thing to happen with Nix recently.

Previously, I think Nix was more of a benefit for the operations (who benefit from "make deployments where the programs run with the same behaviour). Though, I think Docker containers have already eaten that space.

Since Nix Flakes, most of the attention I've seen has been using Nix for developer setups.. where there really isn't much which does what Nix does. (VSCode's devcontainers / GitHub CodeSpaces don't seem to get a lot of attention).

DevEnv seems excellent for developer setups. I'm not sure the devenv services will be able to compellingly replace docker-compose setups. But, for nix-empowered developers, the tool looks really neat.

by nucleogenesison 12/26/22, 3:21 PM

My experience with devenv was disappointing. It claims to play well with existing tools but I ended up screwing around with arcane language-specific env cars to get a simple Python/pyenv/node setup going. It wasn’t quite so “oh just add your packages and roll” it was just like anything else “add your packages and fiddle with it til it works” and then it basically never worked. I was excited for it but it didn’t really add much value for me

by emptysongglasson 12/26/22, 6:16 AM

For an alternative discussed here on HN 5 days ago there's Devbox [1], which uses Nix but doesn't require your team to know Nix to get started.

[1] https://news.ycombinator.com/item?id=34073950

by jackconsidineon 12/26/22, 4:34 AM

This is a great guide! Took a stab at DevEnv a few weeks back after reading about it (and loving the concept). It messed with my OS host path / install locations for non-devenv packages and I found the docs to be lacking. So thanks for this great example

by fomine3on 12/26/22, 5:50 AM

devenv is the name of Visual Studio executable for a long time. I wonder why it choose the name.