Skip to content

Commit 40f3c0d

Browse files
author
IOHK
committed
Update gh-pages for 28ed2a6
1 parent b00eebb commit 40f3c0d

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed

print.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,24 @@ <h2 id="going-forward"><a class="header" href="#going-forward">Going forward</a>
419419
project and its dependencies into Nix code.</p>
420420
<p>Assuming you have <a href="https://nixos.org/download.html">Nix</a> installed, you can
421421
start setting up your project.</p>
422+
<h2 id="using-flake-init-and-nix"><a class="header" href="#using-flake-init-and-nix">Using <code>flake init</code> and <code>nix</code></a></h2>
423+
<p>The <code>flake init</code> command create an example <code>hello</code> package from hackage
424+
containing an <code>flake.nix</code> and <code>nix/hix.nix</code> file. The project can be used with
425+
regular <code>nix</code> tools.</p>
426+
<pre><code class="language-bash">nix flake init --template templates#haskell-nix --impure
427+
# `--impure` is required by `builtins.currentSystem`
428+
nix develop
429+
cabal build
430+
</code></pre>
431+
<p>To view the contents of the flake run:</p>
432+
<pre><code>nix flake show
433+
</code></pre>
434+
<p>To build a component with nix:</p>
435+
<pre><code>nix build .#hello:exe:hello
436+
</code></pre>
437+
<p>To build and run a component:</p>
438+
<pre><code>nix run .#hello:exe:hello
439+
</code></pre>
422440
<h2 id="setting-up-the-binary-cache-1"><a class="header" href="#setting-up-the-binary-cache-1">Setting up the binary cache</a></h2>
423441
<p>IMPORTANT: you <em>must</em> do this or you <em>will</em> build several copies of GHC!</p>
424442
<p>You can configure Nix to use our binary cache, which is pushed to by CI, so should contain the artifacts that you need.</p>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

searchindex.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tutorials/getting-started-flakes.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,24 @@ <h1 id="getting-started-with-flakes"><a class="header" href="#getting-started-wi
144144
project and its dependencies into Nix code.</p>
145145
<p>Assuming you have <a href="https://nixos.org/download.html">Nix</a> installed, you can
146146
start setting up your project.</p>
147+
<h2 id="using-flake-init-and-nix"><a class="header" href="#using-flake-init-and-nix">Using <code>flake init</code> and <code>nix</code></a></h2>
148+
<p>The <code>flake init</code> command create an example <code>hello</code> package from hackage
149+
containing an <code>flake.nix</code> and <code>nix/hix.nix</code> file. The project can be used with
150+
regular <code>nix</code> tools.</p>
151+
<pre><code class="language-bash">nix flake init --template templates#haskell-nix --impure
152+
# `--impure` is required by `builtins.currentSystem`
153+
nix develop
154+
cabal build
155+
</code></pre>
156+
<p>To view the contents of the flake run:</p>
157+
<pre><code>nix flake show
158+
</code></pre>
159+
<p>To build a component with nix:</p>
160+
<pre><code>nix build .#hello:exe:hello
161+
</code></pre>
162+
<p>To build and run a component:</p>
163+
<pre><code>nix run .#hello:exe:hello
164+
</code></pre>
147165
<h2 id="setting-up-the-binary-cache"><a class="header" href="#setting-up-the-binary-cache">Setting up the binary cache</a></h2>
148166
<p>IMPORTANT: you <em>must</em> do this or you <em>will</em> build several copies of GHC!</p>
149167
<p>You can configure Nix to use our binary cache, which is pushed to by CI, so should contain the artifacts that you need.</p>

0 commit comments

Comments
 (0)