@@ -228,11 +228,11 @@ let
228
228
<article class="page-width">
229
229
${ heading 1 null name }
230
230
${ render . metadata . one project . metadata }
231
+ ${ render . options . many ( pick . options project ) }
232
+ ${ render . examples . many ( pick . examples project ) }
231
233
${ optionalString ( project . nixos . examples ? demo ) (
232
234
render . serviceDemo . one project . nixos . modules . services project . nixos . examples . demo
233
235
) }
234
- ${ render . options . many ( pick . options project ) }
235
- ${ render . examples . many ( pick . examples project ) }
236
236
</article>
237
237
'' ;
238
238
@@ -298,30 +298,49 @@ let
298
298
servicePort = ( builtins . head openPorts ) ;
299
299
in
300
300
''
301
- ${ heading 2 "demo" "Run a demo deployment locally" }
301
+ ${ heading 2 "demo" "Demo" }
302
+ <details>
303
+ <summary>Run service in a VM</summary>
302
304
303
305
<ol>
304
- <li><strong>Install Nix on your platform.</strong></li>
305
306
<li>
306
- <strong>Download this Nix file to your computer.</strong>
307
- It obtains the NGIpkgs source code and declares a basic service configuration
308
- to be run in a virtual machine.
309
- ${ render . codeSnippet . one {
310
- filename = "default.nix" ;
311
- relative = true ;
312
- downloadable = true ;
313
- } }
307
+ <strong>Install Nix</strong>
308
+ <ul>
309
+ <li>Arch Linux</li>
310
+ <pre><code>pacman --sync --refresh --noconfirm curl git jq nix</code></pre>
311
+ <li>Debian/Ubuntu</li>
312
+ <pre><code>apt install --yes curl git jq nix</code></pre>
313
+ </ul>
314
+ </li>
315
+ <li>
316
+ <strong>Download a configuration file</strong>
317
+ ${ render . codeSnippet . one {
318
+ filename = "default.nix" ;
319
+ relative = true ;
320
+ downloadable = true ;
321
+ } }
322
+ </li>
323
+ <li>
324
+ <strong>Enable binary substituters</strong>
325
+ <pre><code>NIX_CONFIG='substituters = https://cache.nixos.org/ https://ngi.cachix.org/'$'\n''' trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ngi.cachix.org-1:n+CAL72ROC3qQuLxIHpV+Tw5t42WhXmMhprAGkRSrOw='</code></pre>
326
+ <pre><code>export NIX_CONFIG</code></pre>
314
327
</li>
315
328
<li>
316
- <strong>Build the virtual machine</strong> defined in <code>default.nix</code> and run it:
317
- <pre><code>nix-build && ./result</code></pre>
318
- Building <strong>will</strong> take a while.
329
+ <strong>Build and run a virtual machine</strong>
330
+ <ul>
331
+ <li>Arch Linux, Debian Sid and Ubuntu 25.04</li>
332
+ <pre><code>nix-build ./default.nix && ./result</code></pre>
333
+ <li>Debian 12 and Ubuntu 24.04/24.10</li>
334
+ <pre><code>rev=$(nix-instantiate --eval --attr sources.nixpkgs.rev https://github.com/ngi-nix/ngipkgs/archive/master.tar.gz | jq --raw-output)</code></pre>
335
+ <pre><code>nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/$rev.tar.gz --packages nix --run "nix-build ./default.nix && ./result"</code></pre>
336
+ </ul>
319
337
</li>
320
338
<li>
321
- <strong>Access the service</strong> with a web browser:
322
- <a href="http://localhost:${ toString servicePort } ">http://localhost:${ toString servicePort } </a>
339
+ <strong>Access the service</strong><br />
340
+ Open a web browser at <a href="http://localhost:${ toString servicePort } ">http://localhost:${ toString servicePort } </a> .
323
341
</li>
324
342
</ol>
343
+ </details>
325
344
'' ;
326
345
} ;
327
346
0 commit comments