|
|
|
|
@ -172,14 +172,14 @@
|
|
|
|
|
<ul class="sectlevel2">
|
|
|
|
|
<li><a href="#_running_programs_directly_without_installing_them">10.1. Running programs directly (without installing them)</a>
|
|
|
|
|
<ul class="sectlevel3">
|
|
|
|
|
<li><a href="#_a_top_level_package_from_the_nixpkgsnixos_repo">10.1.1. A top level package from the Nixpkgs/NixOS repo</a></li>
|
|
|
|
|
<li><a href="#_run_a_top_level_package_from_the_nixpkgsnixos_repo">10.1.1. Run a top level package from the Nixpkgs/NixOS repo</a></li>
|
|
|
|
|
<li><a href="#flakeref">10.1.2. Flakes</a>
|
|
|
|
|
<ul class="sectlevel4">
|
|
|
|
|
<li><a href="#_a_flake_defined_in_a_local_file">A flake defined in a local file</a></li>
|
|
|
|
|
<li><a href="#_a_flake_defined_in_a_remote_git_repo">A flake defined in a remote git repo</a></li>
|
|
|
|
|
<li><a href="#_a_flake_defined_in_a_zip_archive">A flake defined in a zip archive</a></li>
|
|
|
|
|
<li><a href="#_a_flake_defined_in_a_compressed_tar_archive">A flake defined in a compressed tar archive</a></li>
|
|
|
|
|
<li><a href="#_other_types_of_flake_references">Other types of flake references</a></li>
|
|
|
|
|
<li><a href="#_run_a_flake_defined_in_a_local_file">Run a flake defined in a local file</a></li>
|
|
|
|
|
<li><a href="#_run_a_flake_defined_in_a_remote_git_repo">Run a flake defined in a remote git repo</a></li>
|
|
|
|
|
<li><a href="#_run_a_flake_defined_in_a_zip_archive">Run a flake defined in a zip archive</a></li>
|
|
|
|
|
<li><a href="#_run_a_flake_defined_in_a_compressed_tar_archive">Run a flake defined in a compressed tar archive</a></li>
|
|
|
|
|
<li><a href="#_run_other_types_of_flake_references">Run other types of flake references</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
@ -200,27 +200,14 @@
|
|
|
|
|
</li>
|
|
|
|
|
<li><a href="#_development_shells">10.4. Development shells</a>
|
|
|
|
|
<ul class="sectlevel3">
|
|
|
|
|
<li><a href="#_a_top_level_package_from_the_nixpkgsnixos_repo_2">10.4.1. A top level package from the Nixpkgs/NixOS repo</a></li>
|
|
|
|
|
<li><a href="#_a_flake">10.4.2. A flake</a></li>
|
|
|
|
|
<li><a href="#_a_haskell_library_package_in_the_nixpkgs_repo_without_a_cabal_file">10.4.3. A Haskell library package in the nixpkgs repo (without a <code>.cabal</code> file)</a></li>
|
|
|
|
|
<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="#_set_an_environment_variable">10.4.5. Set an environment variable</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
<li><a href="#_an_old_style_nix_shell_with_access_to_a_flake">10.5. An (old-style) Nix shell with access to a flake</a></li>
|
|
|
|
|
<li><a href="#_access_to_a_haskell_package_on_your_local_computer">10.6. Access to a Haskell package on your local computer</a>
|
|
|
|
|
<ul class="sectlevel3">
|
|
|
|
|
<li><a href="#_in_shell_nix">10.6.1. In <code>shell.nix</code></a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
<li><a href="#_access_to_a_haskell_package_on_your_local_computer_with_inter_dependencies">10.7. Access to a Haskell package on your local computer, with inter-dependencies</a>
|
|
|
|
|
<ul class="sectlevel3">
|
|
|
|
|
<li><a href="#_in_shell_nix_2">10.7.1. In <code>shell.nix</code></a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
<li><a href="#_set_an_environment_variable">10.8. Set an environment variable</a>
|
|
|
|
|
<ul class="sectlevel3">
|
|
|
|
|
<li><a href="#_in_shell_nix_3">10.8.1. In <code>shell.nix</code></a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
@ -4039,7 +4026,7 @@ including defining environments that you will use more than once.</p>
|
|
|
|
|
<div class="sect2">
|
|
|
|
|
<h3 id="_running_programs_directly_without_installing_them">10.1. Running programs directly (without installing them)</h3>
|
|
|
|
|
<div class="sect3">
|
|
|
|
|
<h4 id="_a_top_level_package_from_the_nixpkgsnixos_repo">10.1.1. A top level package from the Nixpkgs/NixOS repo</h4>
|
|
|
|
|
<h4 id="_run_a_top_level_package_from_the_nixpkgsnixos_repo">10.1.1. Run a top level package from the Nixpkgs/NixOS repo</h4>
|
|
|
|
|
<div class="literalblock">
|
|
|
|
|
<div class="content">
|
|
|
|
|
<pre class="nowrap">$ nix run nixpkgs#cowsay "Moo!"
|
|
|
|
|
@ -4057,7 +4044,7 @@ including defining environments that you will use more than once.</p>
|
|
|
|
|
<div class="sect3">
|
|
|
|
|
<h4 id="flakeref">10.1.2. Flakes</h4>
|
|
|
|
|
<div class="sect4">
|
|
|
|
|
<h5 id="_a_flake_defined_in_a_local_file">A flake defined in a local file</h5>
|
|
|
|
|
<h5 id="_run_a_flake_defined_in_a_local_file">Run a flake defined in a local file</h5>
|
|
|
|
|
<div class="literalblock">
|
|
|
|
|
<div class="content">
|
|
|
|
|
<pre class="nowrap">$ nix run ~/codeberg/hello-flake
|
|
|
|
|
@ -4066,7 +4053,7 @@ Hello from your flake!</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect4">
|
|
|
|
|
<h5 id="_a_flake_defined_in_a_remote_git_repo">A flake defined in a remote git repo</h5>
|
|
|
|
|
<h5 id="_run_a_flake_defined_in_a_remote_git_repo">Run a flake defined in a remote git repo</h5>
|
|
|
|
|
<div class="literalblock">
|
|
|
|
|
<div class="content">
|
|
|
|
|
<pre class="nowrap">$ nix run git+https://codeberg.org/mhwombat/hello-flake
|
|
|
|
|
@ -4093,7 +4080,7 @@ To run a specific branch, use the command below.</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect4">
|
|
|
|
|
<h5 id="_a_flake_defined_in_a_zip_archive">A flake defined in a zip archive</h5>
|
|
|
|
|
<h5 id="_run_a_flake_defined_in_a_zip_archive">Run a flake defined in a zip archive</h5>
|
|
|
|
|
<div class="literalblock">
|
|
|
|
|
<div class="content">
|
|
|
|
|
<pre class="nowrap">$ nix run https://codeberg.org/mhwombat/hello-flake/archive/main.zip
|
|
|
|
|
@ -4103,7 +4090,7 @@ Hello from your flake!</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect4">
|
|
|
|
|
<h5 id="_a_flake_defined_in_a_compressed_tar_archive">A flake defined in a compressed tar archive</h5>
|
|
|
|
|
<h5 id="_run_a_flake_defined_in_a_compressed_tar_archive">Run a flake defined in a compressed tar archive</h5>
|
|
|
|
|
<div class="literalblock">
|
|
|
|
|
<div class="content">
|
|
|
|
|
<pre class="nowrap">$ nix run https://codeberg.org/mhwombat/hello-flake/archive/main.tar.gz
|
|
|
|
|
@ -4113,7 +4100,7 @@ Hello from your flake!</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect4">
|
|
|
|
|
<h5 id="_other_types_of_flake_references">Other types of flake references</h5>
|
|
|
|
|
<h5 id="_run_other_types_of_flake_references">Run other types of flake references</h5>
|
|
|
|
|
<div class="paragraph">
|
|
|
|
|
<p>See <a href="https://nix.dev/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-reference-attributes" class="bare">https://nix.dev/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-reference-attributes</a>.</p>
|
|
|
|
|
</div>
|
|
|
|
|
@ -4318,7 +4305,7 @@ sanitized: <strong>some text</strong></pre>
|
|
|
|
|
<div class="sect2">
|
|
|
|
|
<h3 id="_development_shells">10.4. Development shells</h3>
|
|
|
|
|
<div class="sect3">
|
|
|
|
|
<h4 id="_a_top_level_package_from_the_nixpkgsnixos_repo_2">10.4.1. A top level package from the Nixpkgs/NixOS repo</h4>
|
|
|
|
|
<h4 id="_access_a_top_level_package_from_the_nixpkgsnixos_repo_3">10.4.1. Access a top level package from the Nixpkgs/NixOS repo</h4>
|
|
|
|
|
<div class="listingblock">
|
|
|
|
|
<div class="title">flake.nix</div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
@ -4385,7 +4372,7 @@ $ cowsay "Moo!"
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect3">
|
|
|
|
|
<h4 id="_a_flake">10.4.2. A flake</h4>
|
|
|
|
|
<h4 id="_access_a_flake_3">10.4.2. Access a flake</h4>
|
|
|
|
|
<div class="paragraph">
|
|
|
|
|
<p>In this example, we will use a flake defined in a remote git repo.
|
|
|
|
|
However, you can use any of the flake reference styles defined in <a href="#flakeref">Section 10.1.2, “Flakes”</a>.</p>
|
|
|
|
|
@ -4503,7 +4490,7 @@ Hello from your flake!</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect3">
|
|
|
|
|
<h4 id="_a_haskell_library_package_in_the_nixpkgs_repo_without_a_cabal_file">10.4.3. A Haskell library package in the nixpkgs repo (without a <code>.cabal</code> file)</h4>
|
|
|
|
|
<h4 id="_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)</h4>
|
|
|
|
|
<div class="paragraph">
|
|
|
|
|
<p>Occasionally you might want to run a short Haskell program that depends on a Haskell library,
|
|
|
|
|
but you don’t want to bother writing a cabal file.</p>
|
|
|
|
|
@ -4598,6 +4585,136 @@ $ runghc Main.hs
|
|
|
|
|
"I have 3 cats, 2 dogs, and 0 zebras."</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</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>
|
|
|
|
|
<div class="paragraph">
|
|
|
|
|
<p>Ex: 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>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="listingblock">
|
|
|
|
|
<div class="title">flake.nix</div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<pre class="pygments highlight nowrap" style="background: #f8f8f8;"><code data-lang="nix"><div class="lineno"><table class="linenotable"><tr><td class="linenos"><div class="linenodiv"><pre><span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 1</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 2</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 3</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 4</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 5</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 6</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 7</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 8</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 9</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">10</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">11</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">12</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">13</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">14</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">15</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">16</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">17</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">18</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">19</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">20</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">21</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">22</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">23</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">24</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">25</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">26</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">27</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">28</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">29</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">30</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">31</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">32</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">33</span></pre></div></td><td class="code"><div><pre style="line-height: 125%;"><span></span>{
|
|
|
|
|
<span style="color: #19177C">description</span> <span style="color: #666666">=</span> <span style="color: #BA2121">"Pandoc build system for maths web"</span>;
|
|
|
|
|
|
|
|
|
|
<span style="color: #19177C">inputs</span> <span style="color: #666666">=</span> {
|
|
|
|
|
nixpkgs<span style="color: #666666">.</span><span style="color: #19177C">url</span> <span style="color: #666666">=</span> <span style="color: #BA2121">"github:nixos/nixpkgs/nixpkgs-unstable"</span>;
|
|
|
|
|
flake-parts<span style="color: #666666">.</span><span style="color: #19177C">url</span> <span style="color: #666666">=</span> <span style="color: #BA2121">"github:hercules-ci/flake-parts"</span>;
|
|
|
|
|
haskell-flake<span style="color: #666666">.</span><span style="color: #19177C">url</span> <span style="color: #666666">=</span> <span style="color: #BA2121">"github:srid/haskell-flake"</span>;
|
|
|
|
|
pandoc-linear-table<span style="color: #666666">.</span><span style="color: #19177C">url</span> <span style="color: #666666">=</span> <span style="color: #BA2121">"/home/amy/github/pandoc-linear-table"</span>;
|
|
|
|
|
pandoc-logic-proof<span style="color: #666666">.</span><span style="color: #19177C">url</span> <span style="color: #666666">=</span> <span style="color: #BA2121">"/home/amy/github/pandoc-logic-proof"</span>;
|
|
|
|
|
pandoc-columns<span style="color: #666666">.</span><span style="color: #19177C">url</span> <span style="color: #666666">=</span> <span style="color: #BA2121">"/home/amy/github/pandoc-columns"</span>;
|
|
|
|
|
pandoc-query<span style="color: #666666">.</span><span style="color: #19177C">url</span> <span style="color: #666666">=</span> <span style="color: #BA2121">"/home/amy/codeberg/pandoc-query"</span>;
|
|
|
|
|
};
|
|
|
|
|
<span style="color: #19177C">outputs</span> <span style="color: #666666">=</span> inputs@{ self, nixpkgs, flake-parts, pandoc-linear-table, pandoc-logic-proof, pandoc-columns, pandoc-query, <span style="color: #666666">...</span> }:
|
|
|
|
|
flake-parts<span style="color: #666666">.</span>lib<span style="color: #666666">.</span>mkFlake { <span style="color: #008000; font-weight: bold">inherit</span> inputs; } {
|
|
|
|
|
<span style="color: #19177C">systems</span> <span style="color: #666666">=</span> nixpkgs<span style="color: #666666">.</span>lib<span style="color: #666666">.</span>systems<span style="color: #666666">.</span>flakeExposed;
|
|
|
|
|
<span style="color: #19177C">imports</span> <span style="color: #666666">=</span> [ inputs<span style="color: #666666">.</span>haskell-flake<span style="color: #666666">.</span>flakeModule ];
|
|
|
|
|
|
|
|
|
|
<span style="color: #19177C">perSystem</span> <span style="color: #666666">=</span> { self', pkgs, <span style="color: #666666">...</span> }: {
|
|
|
|
|
haskellProjects<span style="color: #666666">.</span><span style="color: #19177C">default</span> <span style="color: #666666">=</span> {
|
|
|
|
|
<span style="color: #3D7B7B; font-style: italic"># use my versions of some Haskell pagkages instead of the nixpkgs versions</span>
|
|
|
|
|
<span style="color: #19177C">packages</span> <span style="color: #666666">=</span> {
|
|
|
|
|
pandoc-linear-table<span style="color: #666666">.</span><span style="color: #19177C">source</span> <span style="color: #666666">=</span> inputs<span style="color: #666666">.</span>pandoc-linear-table;
|
|
|
|
|
pandoc-logic-proof<span style="color: #666666">.</span><span style="color: #19177C">source</span> <span style="color: #666666">=</span> inputs<span style="color: #666666">.</span>pandoc-logic-proof;
|
|
|
|
|
pandoc-columns<span style="color: #666666">.</span><span style="color: #19177C">source</span> <span style="color: #666666">=</span> inputs<span style="color: #666666">.</span>pandoc-columns;
|
|
|
|
|
pandoc-query<span style="color: #666666">.</span><span style="color: #19177C">source</span> <span style="color: #666666">=</span> inputs<span style="color: #666666">.</span>pandoc-query;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
<span style="color: #3D7B7B; font-style: italic"># haskell-flake doesn't set the default package, but you can do it here.</span>
|
|
|
|
|
packages<span style="color: #666666">.</span><span style="color: #19177C">default</span> <span style="color: #666666">=</span> self'<span style="color: #666666">.</span>packages<span style="color: #666666">.</span>pandoc-maths-web;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
</pre></div></td></tr></table></div></code></pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect3">
|
|
|
|
|
<h4 id="_set_an_environment_variable">10.4.5. Set an environment variable</h4>
|
|
|
|
|
<div class="paragraph">
|
|
|
|
|
<p>Set the value of the environment variable FOO to “bar”.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="listingblock">
|
|
|
|
|
<div class="title">flake.nix</div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<pre class="pygments highlight nowrap" style="background: #f8f8f8;"><code data-lang="nix"><div class="lineno"><table class="linenotable"><tr><td class="linenos"><div class="linenodiv"><pre><span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 1</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 2</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 3</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 4</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 5</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 6</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 7</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 8</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 9</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">10</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">11</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">12</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">13</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">14</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">15</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">16</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">17</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">18</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">19</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">20</span></pre></div></td><td class="code"><div><pre style="line-height: 125%;"><span></span>{
|
|
|
|
|
<span style="color: #19177C">inputs</span> <span style="color: #666666">=</span> {
|
|
|
|
|
nixpkgs<span style="color: #666666">.</span><span style="color: #19177C">url</span> <span style="color: #666666">=</span> <span style="color: #BA2121">"github:NixOS/nixpkgs"</span>;
|
|
|
|
|
flake-utils<span style="color: #666666">.</span><span style="color: #19177C">url</span> <span style="color: #666666">=</span> <span style="color: #BA2121">"github:numtide/flake-utils"</span>;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
<span style="color: #19177C">outputs</span> <span style="color: #666666">=</span> { self, nixpkgs, flake-utils }:
|
|
|
|
|
flake-utils<span style="color: #666666">.</span>lib<span style="color: #666666">.</span>eachDefaultSystem (system:
|
|
|
|
|
<span style="color: #008000; font-weight: bold">let</span>
|
|
|
|
|
<span style="color: #19177C">pkgs</span> <span style="color: #666666">=</span> <span style="color: #008000">import</span> nixpkgs { <span style="color: #008000; font-weight: bold">inherit</span> system; };
|
|
|
|
|
<span style="color: #008000; font-weight: bold">in</span>
|
|
|
|
|
{
|
|
|
|
|
<span style="color: #19177C">devShells</span> <span style="color: #666666">=</span> <span style="color: #008000; font-weight: bold">rec</span> {
|
|
|
|
|
<span style="color: #19177C">default</span> <span style="color: #666666">=</span> pkgs<span style="color: #666666">.</span>mkShell {
|
|
|
|
|
<span style="color: #19177C">packages</span> <span style="color: #666666">=</span> [ pkgs<span style="color: #666666">.</span>cowsay ];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
</pre></div></td></tr></table></div></code></pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="paragraph">
|
|
|
|
|
<p>/// SKIP include::non-flake/main-generated.adoc[leveloffset=+1]</p>
|
|
|
|
|
</div>
|
|
|
|
|
@ -4648,131 +4765,6 @@ Hello from your flake!</pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect2">
|
|
|
|
|
<h3 id="_access_to_a_haskell_package_on_your_local_computer">10.6. Access to a Haskell package on your local computer</h3>
|
|
|
|
|
<div class="paragraph">
|
|
|
|
|
<p>Ex: 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>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect3">
|
|
|
|
|
<h4 id="_in_shell_nix">10.6.1. In <code>shell.nix</code></h4>
|
|
|
|
|
<div class="listingblock">
|
|
|
|
|
<div class="title">shell.nix</div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<pre class="pygments highlight nowrap" style="background: #f8f8f8;"><code data-lang="nix"><div class="lineno"><table class="linenotable"><tr><td class="linenos"><div class="linenodiv"><pre><span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 1</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 2</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 3</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 4</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 5</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 6</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 7</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 8</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 9</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">10</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">11</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">12</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">13</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">14</span></pre></div></td><td class="code"><div><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">with</span> (<span style="color: #008000">import</span> <nixpkgs> {});
|
|
|
|
|
<span style="color: #008000; font-weight: bold">let</span>
|
|
|
|
|
<span style="color: #19177C">pandoc-linear-table</span> <span style="color: #666666">=</span> haskellPackages<span style="color: #666666">.</span>callCabal2nix <span style="color: #BA2121">"pandoc-linear-table"</span> /home/amy/github/pandoc-linear-table {};
|
|
|
|
|
<span style="color: #19177C">pandoc-logic-proof</span> <span style="color: #666666">=</span> haskellPackages<span style="color: #666666">.</span>callCabal2nix <span style="color: #BA2121">"pandoc-logic-proof"</span> /home/amy/github/pandoc-logic-proof {};
|
|
|
|
|
<span style="color: #19177C">pandoc-columns</span> <span style="color: #666666">=</span> haskellPackages<span style="color: #666666">.</span>callCabal2nix <span style="color: #BA2121">"pandoc-columns"</span> /home/amy/github/pandoc-columns {};
|
|
|
|
|
<span style="color: #008000; font-weight: bold">in</span>
|
|
|
|
|
mkShell {
|
|
|
|
|
<span style="color: #19177C">buildInputs</span> <span style="color: #666666">=</span> [
|
|
|
|
|
pandoc
|
|
|
|
|
pandoc-linear-table
|
|
|
|
|
pandoc-logic-proof
|
|
|
|
|
pandoc-columns
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
</pre></div></td></tr></table></div></code></pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect2">
|
|
|
|
|
<h3 id="_access_to_a_haskell_package_on_your_local_computer_with_inter_dependencies">10.7. Access to a Haskell package on your local computer, with inter-dependencies</h3>
|
|
|
|
|
<div class="paragraph">
|
|
|
|
|
<p>Ex: Access four Haskell packages
|
|
|
|
|
(<code>pandoc-linear-table</code>, <code>pandoc-logic-proof</code>, <code>pandoc-columns</code> and <code>pandoc-maths-web</code>)
|
|
|
|
|
that are on my hard drive.
|
|
|
|
|
The fourth package depends on the first three to build.</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect3">
|
|
|
|
|
<h4 id="_in_shell_nix_2">10.7.1. In <code>shell.nix</code></h4>
|
|
|
|
|
<div class="listingblock">
|
|
|
|
|
<div class="title">shell.nix</div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<pre class="pygments highlight nowrap" style="background: #f8f8f8;"><code data-lang="nix"><div class="lineno"><table class="linenotable"><tr><td class="linenos"><div class="linenodiv"><pre><span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 1</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 2</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 3</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 4</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 5</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 6</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 7</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 8</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;"> 9</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">10</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">11</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">12</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">13</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">14</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">15</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">16</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">17</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">18</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">19</span></pre></div></td><td class="code"><div><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">with</span> (<span style="color: #008000">import</span> <nixpkgs> {});
|
|
|
|
|
<span style="color: #008000; font-weight: bold">let</span>
|
|
|
|
|
<span style="color: #19177C">pandoc-linear-table</span> <span style="color: #666666">=</span> haskellPackages<span style="color: #666666">.</span>callCabal2nix <span style="color: #BA2121">"pandoc-linear-table"</span> /home/amy/github/pandoc-linear-table {};
|
|
|
|
|
<span style="color: #19177C">pandoc-logic-proof</span> <span style="color: #666666">=</span> haskellPackages<span style="color: #666666">.</span>callCabal2nix <span style="color: #BA2121">"pandoc-logic-proof"</span> /home/amy/github/pandoc-logic-proof {};
|
|
|
|
|
<span style="color: #19177C">pandoc-columns</span> <span style="color: #666666">=</span> haskellPackages<span style="color: #666666">.</span>callCabal2nix <span style="color: #BA2121">"pandoc-columns"</span> /home/amy/github/pandoc-columns {};
|
|
|
|
|
<span style="color: #19177C">pandoc-maths-web</span> <span style="color: #666666">=</span> haskellPackages<span style="color: #666666">.</span>callCabal2nix <span style="color: #BA2121">"pandoc-maths-web"</span> /home/amy/github/pandoc-maths-web
|
|
|
|
|
{
|
|
|
|
|
<span style="color: #008000; font-weight: bold">inherit</span> pandoc-linear-table pandoc-logic-proof pandoc-columns;
|
|
|
|
|
};
|
|
|
|
|
<span style="color: #008000; font-weight: bold">in</span>
|
|
|
|
|
mkShell {
|
|
|
|
|
<span style="color: #19177C">buildInputs</span> <span style="color: #666666">=</span> [
|
|
|
|
|
pandoc
|
|
|
|
|
pandoc-linear-table
|
|
|
|
|
pandoc-logic-proof
|
|
|
|
|
pandoc-columns
|
|
|
|
|
pandoc-maths-web
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
</pre></div></td></tr></table></div></code></pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect2">
|
|
|
|
|
<h3 id="_set_an_environment_variable">10.8. Set an environment variable</h3>
|
|
|
|
|
<div class="paragraph">
|
|
|
|
|
<p>Ex: Set the value of the environment variable FOO to “bar”</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="sect3">
|
|
|
|
|
<h4 id="_in_shell_nix_3">10.8.1. In <code>shell.nix</code></h4>
|
|
|
|
|
<div class="listingblock">
|
|
|
|
|
<div class="title">shell.nix</div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<pre class="pygments highlight nowrap" style="background: #f8f8f8;"><code data-lang="nix"><div class="lineno"><table class="linenotable"><tr><td class="linenos"><div class="linenodiv"><pre><span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">1</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">2</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">3</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">4</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">5</span>
|
|
|
|
|
<span style="color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px;">6</span></pre></div></td><td class="code"><div><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">with</span> (<span style="color: #008000">import</span> <nixpkgs> {});
|
|
|
|
|
mkShell {
|
|
|
|
|
<span style="color: #19177C">shellHook</span> <span style="color: #666666">=</span> <span style="color: #BA2121">''</span>
|
|
|
|
|
<span style="color: #BA2121"> export FOO="bar"</span>
|
|
|
|
|
<span style="color: #BA2121"> ''</span>;
|
|
|
|
|
}
|
|
|
|
|
</pre></div></td></tr></table></div></code></pre>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@ -4787,7 +4779,7 @@ mkShell {
|
|
|
|
|
</div>
|
|
|
|
|
<div id="footer">
|
|
|
|
|
<div id="footer-text">
|
|
|
|
|
Last updated 2025-09-05 20:39:24 IST
|
|
|
|
|
Last updated 2025-09-06 17:58:13 IST
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
|