@@ -131,8 +131,8 @@
131131 in <literal>beamPackages</literal>, use the following command:
132132 </para>
133133
134−<programlisting>
135−$ nix-env -f "<nixpkgs>" -qaP -A beamPackages
134+<screen>
135+<prompt>$ </prompt>nix-env -f "<nixpkgs>" -qaP -A beamPackages
136136beamPackages.esqlite esqlite-0.2.1
137137beamPackages.goldrush goldrush-0.1.7
138138beamPackages.ibrowse ibrowse-4.2.2
@@ -140,16 +140,16 @@ beamPackages.jiffy jiffy-0.14.5
140140beamPackages.lager lager-3.0.2
141141beamPackages.meck meck-0.8.3
142142beamPackages.rebar3-pc pc-1.1.0
143− </programlisting>
143+</screen>
144144
145145 <para>
146146 To install any of those packages into your profile, refer to them by their
147147 attribute path (first column):
148148 </para>
149149
150−<programlisting>
151−$ nix-env -f "<nixpkgs>" -iA beamPackages.ibrowse
152− </programlisting>
150+<screen>
151+<prompt>$ </prompt>nix-env -f "<nixpkgs>" -iA beamPackages.ibrowse
152+</screen>
153153
154154 <para>
155155 The attribute path of any BEAM package corresponds to the name of that
@@ -178,22 +178,22 @@ $ nix-env -f "<nixpkgs>" -iA beamPackages.ibrowse
178178 </para>
179179
180180<programlisting>
181− { stdenv, fetchFromGitHub, buildRebar3, ibrowse, jsx, erlware_commons }:
181+{ stdenv, fetchFromGitHub, buildRebar3, ibrowse, jsx, erlware_commons }:
182182
183− buildRebar3 rec {
184− name = "hex2nix";
185− version = "0.0.1";
183+buildRebar3 rec {
184+ name = "hex2nix";
185+ version = "0.0.1";
186186
187− src = fetchFromGitHub {
188− owner = "ericbmerritt";
189− repo = "hex2nix";
190− rev = "${version}";
191− sha256 = "1w7xjidz1l5yjmhlplfx7kphmnpvqm67w99hd2m7kdixwdxq0zqg";
192− };
187+ src = fetchFromGitHub {
188+ owner = "ericbmerritt";
189+ repo = "hex2nix";
190+ rev = "${version}";
191+ sha256 = "1w7xjidz1l5yjmhlplfx7kphmnpvqm67w99hd2m7kdixwdxq0zqg";
192+ };
193193
194− beamDeps = [ ibrowse jsx erlware_commons ];
195− }
196− </programlisting>
194+ beamDeps = [ ibrowse jsx erlware_commons ];
195+}
196+</programlisting>
197197
198198 <para>
199199 Such derivations are callable with
@@ -228,29 +228,29 @@ $ nix-env -f "<nixpkgs>" -iA beamPackages.ibrowse
228228 </para>
229229
230230<programlisting>
231− { buildErlangMk, fetchHex, cowlib, ranch }:
232−
233− buildErlangMk {
234− name = "cowboy";
235− version = "1.0.4";
236−
237− src = fetchHex {
238− pkg = "cowboy";
239− version = "1.0.4";
240− sha256 = "6a0edee96885fae3a8dd0ac1f333538a42e807db638a9453064ccfdaa6b9fdac";
241− };
242−
243− beamDeps = [ cowlib ranch ];
244−
245− meta = {
246− description = ''
247− Small, fast, modular HTTP server written in Erlang
248− '';
249− license = stdenv.lib.licenses.isc;
250− homepage = https://github.com/ninenines/cowboy;
251− };
252− }
253− </programlisting>
231+{ buildErlangMk, fetchHex, cowlib, ranch }:
232+
233+buildErlangMk {
234+ name = "cowboy";
235+ version = "1.0.4";
236+
237+ src = fetchHex {
238+ pkg = "cowboy";
239+ version = "1.0.4";
240+ sha256 = "6a0edee96885fae3a8dd0ac1f333538a42e807db638a9453064ccfdaa6b9fdac";
241+ };
242+
243+ beamDeps = [ cowlib ranch ];
244+
245+ meta = {
246+ description = ''
247+ Small, fast, modular HTTP server written in Erlang
248+ '';
249+ license = stdenv.lib.licenses.isc;
250+ homepage = https://github.com/ninenines/cowboy;
251+ };
252+}
253+</programlisting>
254254 </section>
255255
256256 <section xml:id="mix-packages">
@@ -262,56 +262,56 @@ $ nix-env -f "<nixpkgs>" -iA beamPackages.ibrowse
262262 </para>
263263
264264<programlisting>
265− { buildMix, fetchHex, plug, absinthe }:
266−
267− buildMix {
268− name = "absinthe_plug";
269− version = "1.0.0";
270−
271− src = fetchHex {
272− pkg = "absinthe_plug";
273− version = "1.0.0";
274− sha256 = "08459823fe1fd4f0325a8bf0c937a4520583a5a26d73b193040ab30a1dfc0b33";
275− };
276−
277− beamDeps = [ plug absinthe ];
278−
279− meta = {
280− description = ''
281− A plug for Absinthe, an experimental GraphQL toolkit
282− '';
283− license = stdenv.lib.licenses.bsd3;
284− homepage = https://github.com/CargoSense/absinthe_plug;
285− };
286− }
287− </programlisting>
265+{ buildMix, fetchHex, plug, absinthe }:
266+
267+buildMix {
268+ name = "absinthe_plug";
269+ version = "1.0.0";
270+
271+ src = fetchHex {
272+ pkg = "absinthe_plug";
273+ version = "1.0.0";
274+ sha256 = "08459823fe1fd4f0325a8bf0c937a4520583a5a26d73b193040ab30a1dfc0b33";
275+ };
276+
277+ beamDeps = [ plug absinthe ];
278+
279+ meta = {
280+ description = ''
281+ A plug for Absinthe, an experimental GraphQL toolkit
282+ '';
283+ license = stdenv.lib.licenses.bsd3;
284+ homepage = https://github.com/CargoSense/absinthe_plug;
285+ };
286+}
287+</programlisting>
288288
289289 <para>
290290 Alternatively, we can use <literal>buildHex</literal> as a shortcut:
291291 </para>
292292
293293<programlisting>
294− { buildHex, buildMix, plug, absinthe }:
294+{ buildHex, buildMix, plug, absinthe }:
295295
296− buildHex {
297− name = "absinthe_plug";
298− version = "1.0.0";
296+buildHex {
297+ name = "absinthe_plug";
298+ version = "1.0.0";
299299
300− sha256 = "08459823fe1fd4f0325a8bf0c937a4520583a5a26d73b193040ab30a1dfc0b33";
300+ sha256 = "08459823fe1fd4f0325a8bf0c937a4520583a5a26d73b193040ab30a1dfc0b33";
301301
302− builder = buildMix;
302+ builder = buildMix;
303303
304− beamDeps = [ plug absinthe ];
304+ beamDeps = [ plug absinthe ];
305305
306− meta = {
307− description = ''
308− A plug for Absinthe, an experimental GraphQL toolkit
309− '';
310− license = stdenv.lib.licenses.bsd3;
311− homepage = https://github.com/CargoSense/absinthe_plug;
312− };
313− }
314− </programlisting>
306+ meta = {
307+ description = ''
308+ A plug for Absinthe, an experimental GraphQL toolkit
309+ '';
310+ license = stdenv.lib.licenses.bsd3;
311+ homepage = https://github.com/CargoSense/absinthe_plug;
312+ };
313+}
314+</programlisting>
315315 </section>
316316 </section>
317317 </section>
@@ -330,47 +330,47 @@ $ nix-env -f "<nixpkgs>" -iA beamPackages.ibrowse
330330 could do the following:
331331 </para>
332332
333−<programlisting>
334− $ nix-shell -A beamPackages.ibrowse.env --run "erl"
335− Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
336−
337− Eshell V7.0 (abort with ^G)
338− 1> m(ibrowse).
339− Module: ibrowse
340− MD5: 3b3e0137d0cbb28070146978a3392945
341− Compiled: January 10 2016, 23:34
342− Object file: /nix/store/g1rlf65rdgjs4abbyj4grp37ry7ywivj-ibrowse-4.2.2/lib/erlang/lib/ibrowse-4.2.2/ebin/ibrowse.beam
343− Compiler options: [{outdir,"/tmp/nix-build-ibrowse-4.2.2.drv-0/hex-source-ibrowse-4.2.2/_build/default/lib/ibrowse/ebin"},
344− debug_info,debug_info,nowarn_shadow_vars,
345− warn_unused_import,warn_unused_vars,warnings_as_errors,
346− {i,"/tmp/nix-build-ibrowse-4.2.2.drv-0/hex-source-ibrowse-4.2.2/_build/default/lib/ibrowse/include"}]
347− Exports:
348− add_config/1 send_req_direct/7
349− all_trace_off/0 set_dest/3
350− code_change/3 set_max_attempts/3
351− get_config_value/1 set_max_pipeline_size/3
352− get_config_value/2 set_max_sessions/3
353− get_metrics/0 show_dest_status/0
354− get_metrics/2 show_dest_status/1
355− handle_call/3 show_dest_status/2
356− handle_cast/2 spawn_link_worker_process/1
357− handle_info/2 spawn_link_worker_process/2
358− init/1 spawn_worker_process/1
359− module_info/0 spawn_worker_process/2
360− module_info/1 start/0
361− rescan_config/0 start_link/0
362− rescan_config/1 stop/0
363− send_req/3 stop_worker_process/1
364− send_req/4 stream_close/1
365− send_req/5 stream_next/1
366− send_req/6 terminate/2
367− send_req_direct/4 trace_off/0
368− send_req_direct/5 trace_off/2
369− send_req_direct/6 trace_on/0
370− trace_on/2
371− ok
372− 2>
373− </programlisting>
333+<screen>
334+<prompt>$ </prompt><userinput>nix-shell -A beamPackages.ibrowse.env --run "erl"</userinput>
335+<computeroutput>Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
336+
337+Eshell V7.0 (abort with ^G)</computeroutput>
338+<prompt>1> </prompt><userinput>m(ibrowse).</userinput>
339+<computeroutput>Module: ibrowse
340+MD5: 3b3e0137d0cbb28070146978a3392945
341+Compiled: January 10 2016, 23:34
342+Object file: /nix/store/g1rlf65rdgjs4abbyj4grp37ry7ywivj-ibrowse-4.2.2/lib/erlang/lib/ibrowse-4.2.2/ebin/ibrowse.beam
343+Compiler options: [{outdir,"/tmp/nix-build-ibrowse-4.2.2.drv-0/hex-source-ibrowse-4.2.2/_build/default/lib/ibrowse/ebin"},
344+debug_info,debug_info,nowarn_shadow_vars,
345+warn_unused_import,warn_unused_vars,warnings_as_errors,
346+{i,"/tmp/nix-build-ibrowse-4.2.2.drv-0/hex-source-ibrowse-4.2.2/_build/default/lib/ibrowse/include"}]
347+Exports:
348+add_config/1 send_req_direct/7
349+all_trace_off/0 set_dest/3
350+code_change/3 set_max_attempts/3
351+get_config_value/1 set_max_pipeline_size/3
352+get_config_value/2 set_max_sessions/3
353+get_metrics/0 show_dest_status/0
354+get_metrics/2 show_dest_status/1
355+handle_call/3 show_dest_status/2
356+handle_cast/2 spawn_link_worker_process/1
357+handle_info/2 spawn_link_worker_process/2
358+init/1 spawn_worker_process/1
359+module_info/0 spawn_worker_process/2
360+module_info/1 start/0
361+rescan_config/0 start_link/0
362+rescan_config/1 stop/0
363+send_req/3 stop_worker_process/1
364+send_req/4 stream_close/1
365+send_req/5 stream_next/1
366+send_req/6 terminate/2
367+send_req_direct/4 trace_off/0
368+send_req_direct/5 trace_off/2
369+send_req_direct/6 trace_on/0
370+trace_on/2
371+ok</computeroutput>
372+<prompt>2></prompt>
373+</screen>
374374
375375 <para>
376376 Notice the <literal>-A beamPackages.ibrowse.env</literal>. That is the key
@@ -408,7 +408,7 @@ let
408408in
409409
410410 drv
411− </programlisting>
411+</programlisting>
412412
413413 <section xml:id="building-in-a-shell">
414414 <title>Building in a Shell (for Mix Projects)</title>
@@ -474,7 +474,7 @@ plt:
474474analyze: build plt
475475 $(NIX_SHELL) --run "mix dialyzer --no-compile"
476476
477− </programlisting>
477+</programlisting>
478478
479479 <para>
480480 Using a <literal>shell.nix</literal> as described (see
@@ -513,9 +513,9 @@ analyze: build plt
513513 <literal>nixpkgs</literal> repository:
514514 </para>
515515
516−<programlisting>
517−$ nix-build -A beamPackages
518− </programlisting>
516+<screen>
517+<prompt>$ </prompt>nix-build -A beamPackages
518+</screen>
519519
520520 <para>
521521 That will attempt to build every package in <literal>beamPackages</literal>.