mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2026-05-15 01:51:20 +08:00
temp
This commit is contained in:
parent
d351582364
commit
c6d4fff7c6
5 changed files with 100 additions and 69 deletions
13
index.html
13
index.html
|
|
@ -4766,8 +4766,8 @@ However, you can use any of the flake reference styles defined in <a href="#flak
|
|||
<span class="hll"> hello-flake<span class="tok-o">.</span><span class="tok-ss">url</span> <span class="tok-o">=</span> <span class="tok-s2">"git+https://codeberg.org/mhwombat/hello-flake"</span><span class="tok-p">;</span>
|
||||
</span> <span class="tok-p">};</span>
|
||||
|
||||
<span class="tok-ss">outputs</span> <span class="tok-o">=</span> <span class="tok-p">{</span> self<span class="tok-p">,</span> nixpkgs<span class="tok-p">,</span> flake-utils<span class="tok-p">,</span> hello-flake <span class="tok-p">}:</span>
|
||||
flake-utils<span class="tok-o">.</span>lib<span class="tok-o">.</span>eachDefaultSystem <span class="tok-p">(</span>system<span class="tok-p">:</span>
|
||||
<span class="hll"> <span class="tok-ss">outputs</span> <span class="tok-o">=</span> <span class="tok-p">{</span> self<span class="tok-p">,</span> nixpkgs<span class="tok-p">,</span> flake-utils<span class="tok-p">,</span> hello-flake <span class="tok-p">}:</span>
|
||||
</span> flake-utils<span class="tok-o">.</span>lib<span class="tok-o">.</span>eachDefaultSystem <span class="tok-p">(</span>system<span class="tok-p">:</span>
|
||||
<span class="tok-k">let</span>
|
||||
<span class="tok-ss">pkgs</span> <span class="tok-o">=</span> <span class="tok-nb">import</span> nixpkgs <span class="tok-p">{</span> <span class="tok-k">inherit</span> system<span class="tok-p">;</span> <span class="tok-p">};</span>
|
||||
<span class="tok-k">in</span>
|
||||
|
|
@ -4784,6 +4784,11 @@ However, you can use any of the flake reference styles defined in <a href="#flak
|
|||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Line 5 adds <code>hello-flake</code> as an input to this flake.
|
||||
Line 8 allows the output function to reference <code>hello-flake</code>.
|
||||
Line 16 adds <code>hello-flake</code> as a build input for this flake.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Let’s take a closer look at the <code>buildInputs</code> expression from line 16.</p>
|
||||
</div>
|
||||
<div class="literalblock">
|
||||
|
|
@ -4803,7 +4808,7 @@ and the last part is the name of the package or app we want.
|
|||
<div class="literalblock">
|
||||
<div class="content">
|
||||
<pre class="nowrap">$ hello-flake # Fails; dependency not available
|
||||
bash: line 31: hello-flake: command not found
|
||||
bash: line 35: hello-flake: command not found
|
||||
$ nix develop
|
||||
$ hello-flake # Works in development environment
|
||||
Hello from your flake!</pre>
|
||||
|
|
@ -5633,7 +5638,7 @@ Hello from your flake!</pre>
|
|||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2025-09-15 17:54:57 IST
|
||||
Last updated 2025-09-15 18:02:04 IST
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue