nix "thing" for dev environment with some service - Nix

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Georgi Lyubenov // googleson78

I haven't used nix for anything before, so as a complete n00b:
Is there a "standard approach" to using nix-shell(or something related?) to be able to pop into a dev environment with some services running in isolation from the rest of the world (e.g. a database, an nginx server).
This would also be useful for deploying anywhere nix is available too.

This would effectively be a replacement for docker images, I guess. Am I actually entirely mistaken, and you can't use nix for this at all (or it isn't very well-suited to the task)?

Sridhar Ratnakumar
  1. You can launch those services in a LXD nixos container (tutorial)
  2. Or, wrap $service so that it is totally contained, eg: for postgres there is https://github.com/obsidiansystems/gargoyle which is used in obelisk.
A framework for managing daemons from Haskell and libraries for use with postgresql and nix - obsidiansystems/gargoyle
Georgi Lyubenov // googleson78

Thanks for the pointers! I'll look into them.
So it's not supported in some "first-class" way, as I originally hoped? (i.e. the functionality is built into nix)

Sridhar Ratnakumar

Well, the standard way is to run NixOS and write a configuration.nix for the whole machine, but this assumes that that machine is dedicated entirely to your project's dev / deployment env.