This commit is contained in:
Amy de Buitléir 2025-09-15 18:08:42 +01:00
parent d351582364
commit c6d4fff7c6
5 changed files with 100 additions and 69 deletions

View file

@ -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">&quot;git+https://codeberg.org/mhwombat/hello-flake&quot;</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&#8217;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>