How to use Nix to setup a development environment? : <p>Let's say I need PostgreSQL 9.6.3 and Ruby 2.3.1 and various other tools. I can't find a tutorial that explains what I need to do.</p>

<p>From the Nix manual, I seem to need to write a <a href="https://nixos.org/nix/manual/#ch-simple-expression" rel="noreferrer">Nix expression</a> to install the needed dependencies, but I can't make the leap from:</p>

<pre><code>{ stdenv, fetchurl, perl }:

stdenv.mkDerivation {
  name = "hello-2.1.1";
  builder = ./builder.sh;
  src = fetchurl {
    url = ftp://ftp.nluug.nl/pub/gnu/hello/hello-2.1.1.tar.gz;
    md5 = "70c9ccf9fac07f762c24f2df2290784d";
  };
  inherit perl;
}
</code></pre>

<p>to the expression that will install the proper PostgreSQL and Ruby versions. It is absolutely unclear to me where to even put the file that installs PostgreSQL and Ruby, or how to run a single file in a given directory.</p>

<p>Can someone provide pointers to such tutorials, or point me in the right direction?</p>
