This commit is contained in:
Amy de Buitléir 2025-09-15 17:39:19 +01:00
parent 781aa484a1
commit 3116896558

View file

@ -5268,6 +5268,20 @@ so our <code>hello-again</code> script won&#8217;t be able to find it.</p>
In this case we simply edited the script (lines 30-32) as we install it,
by specifying the full path to <code>hello-nix</code>.</p>
</div>
<div class="paragraph">
<p>Let&#8217;s take a closer look at the <code>buildInputs</code> expression from line 35.</p>
</div>
<div class="literalblock">
<div class="content">
<pre class="nowrap">hello-flake.packages.${system}.hello</pre>
</div>
</div>
<div class="paragraph">
<p>Why is the first part <code>hello-flake</code> and the last part <code>hello</code>?
The first part refers to the name we assigned in the input section of our flake,
and the last part is the name of the package or app we want.
(See <a href="#_flake_outputs">Section 3.1, &#8220;Flake outputs&#8221;</a> for how to identify flake outputs.)</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
@ -5292,9 +5306,6 @@ In that case, adding the dependency to <code>buildInputs</code> is sufficient.</
<div class="literalblock">
<div class="content">
<pre class="nowrap">$ nix run
this derivation will be built:
/nix/store/aymycx9z7b8qgi0avs73b8c5xc4jxwx3-hello-again.drv
building '/nix/store/aymycx9z7b8qgi0avs73b8c5xc4jxwx3-hello-again.drv'...
I'm a flake, and I'm running a command defined in a another flake.
Hello from your flake!</pre>
</div>
@ -5619,7 +5630,7 @@ Hello from your flake!</pre>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2025-09-15 17:34:09 IST
Last updated 2025-09-15 17:37:10 IST
</div>
</div>
</body>