mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2026-05-12 07:15:53 +08:00
temp
This commit is contained in:
parent
32095c6c91
commit
595d08319e
2 changed files with 59 additions and 6 deletions
49
index.html
49
index.html
|
|
@ -274,7 +274,7 @@ pre.pygments .tok-il { color: #666666 } /* Literal.Number.Integer.Long */
|
|||
<li><a href="#_access_a_top_level_package_from_the_nixpkgsnixos_repo_3">10.4.1. Access a top level package from the Nixpkgs/NixOS repo</a></li>
|
||||
<li><a href="#_access_a_flake_3">10.4.2. Access a flake</a></li>
|
||||
<li><a href="#_access_a_haskell_library_package_in_the_nixpkgs_repo_without_a_cabal_file_2">10.4.3. Access a Haskell library package in the nixpkgs repo (without a <code>.cabal</code> file)</a></li>
|
||||
<li><a href="#_access_to_a_haskell_package_on_your_local_computer">10.4.4. Access to a Haskell package on your local computer</a></li>
|
||||
<li><a href="#_access_to_a_haskell_package_defined_in_a_flake">10.4.4. Access to a Haskell package defined in a flake</a></li>
|
||||
<li><a href="#_set_an_environment_variable">10.4.5. Set an environment variable</a></li>
|
||||
<li><a href="#devshell-nix-non-flake">10.4.6. Access a non-flake package (not in nixpkgs)</a>
|
||||
<ul class="sectlevel4">
|
||||
|
|
@ -4934,11 +4934,13 @@ $ runghc Main.hs
|
|||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_access_to_a_haskell_package_on_your_local_computer">10.4.4. Access to a Haskell package on your local computer</h4>
|
||||
<h4 id="_access_to_a_haskell_package_defined_in_a_flake">10.4.4. Access to a Haskell package defined in a flake</h4>
|
||||
<div class="paragraph">
|
||||
<p>Ex: Access three Haskell packages
|
||||
<p>In this example we will access three Haskell packages
|
||||
(<code>pandoc-linear-table</code>, <code>pandoc-logic-proof</code>, and <code>pandoc-columns</code>)
|
||||
that are on my hard drive.</p>
|
||||
that are defined as flakes on my hard drive.
|
||||
We are using <code>haskell-flake</code>, so the development environment is
|
||||
set up automatically; no need to define <code>devShells</code>.</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="title">flake.nix</div>
|
||||
|
|
@ -4975,7 +4977,8 @@ that are on my hard drive.</p>
|
|||
<span class="normal">30</span>
|
||||
<span class="normal">31</span>
|
||||
<span class="normal">32</span>
|
||||
<span class="normal">33</span></pre></div></td><td class="code"><div><pre><span></span><span class="tok-p">{</span>
|
||||
<span class="normal">33</span>
|
||||
<span class="normal">34</span></pre></div></td><td class="code"><div><pre><span></span><span class="tok-p">{</span>
|
||||
<span class="tok-ss">description</span> <span class="tok-o">=</span> <span class="tok-s2">"Pandoc build system for maths web"</span><span class="tok-p">;</span>
|
||||
|
||||
<span class="tok-ss">inputs</span> <span class="tok-o">=</span> <span class="tok-p">{</span>
|
||||
|
|
@ -4987,6 +4990,7 @@ that are on my hard drive.</p>
|
|||
pandoc-columns<span class="tok-o">.</span><span class="tok-ss">url</span> <span class="tok-o">=</span> <span class="tok-s2">"/home/amy/github/pandoc-columns"</span><span class="tok-p">;</span>
|
||||
pandoc-query<span class="tok-o">.</span><span class="tok-ss">url</span> <span class="tok-o">=</span> <span class="tok-s2">"/home/amy/codeberg/pandoc-query"</span><span class="tok-p">;</span>
|
||||
<span class="tok-p">};</span>
|
||||
|
||||
<span class="tok-ss">outputs</span> <span class="tok-o">=</span> inputs<span class="tok-p">@{</span> self<span class="tok-p">,</span> nixpkgs<span class="tok-p">,</span> flake-parts<span class="tok-p">,</span> pandoc-linear-table<span class="tok-p">,</span> pandoc-logic-proof<span class="tok-p">,</span> pandoc-columns<span class="tok-p">,</span> pandoc-query<span class="tok-p">,</span> <span class="tok-o">...</span> <span class="tok-p">}:</span>
|
||||
flake-parts<span class="tok-o">.</span>lib<span class="tok-o">.</span>mkFlake <span class="tok-p">{</span> <span class="tok-k">inherit</span> inputs<span class="tok-p">;</span> <span class="tok-p">}</span> <span class="tok-p">{</span>
|
||||
<span class="tok-ss">systems</span> <span class="tok-o">=</span> nixpkgs<span class="tok-o">.</span>lib<span class="tok-o">.</span>systems<span class="tok-o">.</span>flakeExposed<span class="tok-p">;</span>
|
||||
|
|
@ -5011,6 +5015,39 @@ that are on my hard drive.</p>
|
|||
</pre></div></td></tr></table></div></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Here’s a demonstration using the shell.</p>
|
||||
</div>
|
||||
<div class="literalblock">
|
||||
<div class="content">
|
||||
<pre class="nowrap">$ nix develop
|
||||
$ cabal info pandoc-columns
|
||||
Warning: The package list for 'hackage.haskell.org' is 22 days old.
|
||||
Run 'cabal update' to get the latest list of available packages.
|
||||
* pandoc-columns (program and library)
|
||||
Synopsis: A pandoc filter that provides a Markdown extension for
|
||||
columns.
|
||||
Versions available: 0.2.0.5
|
||||
Versions installed: [ Not installed ]
|
||||
Homepage: https://github.com/mhwombat/pandoc-columns
|
||||
Bug reports: https://github.com/mhwombat/pandoc-columns/issues
|
||||
Description: For more information and a tutorial on how to use this
|
||||
package, please see the README at
|
||||
<https://github.com/mhwombat/pandoc-columns#readme>.
|
||||
Category: Text
|
||||
License: BSD-3-Clause
|
||||
Author: Amy de Buitléir
|
||||
Maintainer: amy@nualeargais.ie
|
||||
Source repo: https://github.com/mhwombat/pandoc-columns.git
|
||||
Executables: pandoc-columns
|
||||
Dependencies: base >=4.16.4 && <4.17, pandoc-types >=1.22.2 && <1.23,
|
||||
pandoc >=2.19.2 && <2.20, base >=4.16.4 && <4.17,
|
||||
pandoc-types >=1.22.2 && <1.23, pandoc-columns
|
||||
Cached: No
|
||||
Modules:
|
||||
Text.Pandoc.Filters.Columns</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_set_an_environment_variable">10.4.5. Set an environment variable</h4>
|
||||
|
|
@ -5573,7 +5610,7 @@ Hello from your flake!</pre>
|
|||
</div>
|
||||
<div id="footer">
|
||||
<div id="footer-text">
|
||||
Last updated 2025-09-13 20:11:05 IST
|
||||
Last updated 2025-09-13 20:20:17 IST
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -31,6 +31,22 @@ $ cabal info pandoc-columns
|
|||
$# EOL
|
||||
....
|
||||
|
||||
FINISH
|
||||
|
||||
FINISH
|
||||
|
||||
FINISH
|
||||
|
||||
FINISH
|
||||
|
||||
FINISH
|
||||
|
||||
FINISH
|
||||
|
||||
FINISH
|
||||
|
||||
FINISH
|
||||
|
||||
////
|
||||
Good adoc0 scripts clean up after themselves.
|
||||
$ cd .. ; rm -rf tempwork # clean up
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue