Hi,
I would like to introduce nix-shell
/ nix develop
for dev environments at my place of employment. Developers here use linux, mac, and windows. The projects are often web projects and most involve starting at least one container in docker (databases, proprietary services from custom docker registries, simple services like email, etc.).
The editors and IDEs vary, but most common are VScode, vim, and Jetbrains products.
The goal is:
- install nix on a dev machine
- clone a project
- provide
nix-shell
/ nix develop
env with
- ability to run containers
- ability to make signed git commits
- an editor or IDE within the env (no need to mess with paths, env vars, or configurations)
So my question is do tools exist for this or similar situations? Before going off and writing something completely bespoke, the attempt is made to see what’s out there first.
The difficulty, I find, is docker in nix-shell
/ nix develop
. Probably starting a root service from a dev env isn’t a good idea, so rootless docker, podman or something else would be a better alternative. The problem being it has to run on different operating systems.
I’m curious about what others have found that might work or how one would approach this problem.
Thanks in advance
I’m not sure how many of your desired features are possible through it, but you might want to look at https://devenv.sh/
Given this is a corporate use case, you can probably talk to the various nix consultancies, too, they’ll have lots of experience with exactly this kind of deployment, and point out all the pitfalls too. There will be some, web stuff isn’t easy to build, web developers don’t typically like having their usual tools substituted, and using nix on windows can be a challenge.
1 Like
For containers I can recommend podman
. That works fine from a nix shell.
Just wanted to thank you for the responses. I’ve been testing nix-shell
with podman and it’s kinda working / so-so. It’s possible to start the containers, but impossible to do anything else. podman ls
, podman attach
, etc. all don’t work.
devenv
doesn’t have a services.docker
yet, which is the next thing I would like to try implementing since at least that work could be contributed back to devenv
should it work.
Right now, the tests have only been on linux as I wait for mac and windows hardware to arrive in order to test on those too. As this is a side-project at work in order to test whether nix
is viable for a cross platform environment, it is advancing slowly.
Thanks again for the responses. I’ll try to update with progress here and if things work out, contribute back and maybe even write a blog post.
Cheers
1 Like
Doesn’t match the requirements you listed but might still be interesting to you. I personally use distrobox.