Skip to content

Commit 60a3eff

Browse files
author
IOHK
committed
Update gh-pages for 71a34a6
1 parent 242bcc7 commit 60a3eff

File tree

4 files changed

+117
-5
lines changed

4 files changed

+117
-5
lines changed

changelog.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,30 @@ <h1 class="menu-title">Haskell.nix</h1>
168168
<main>
169169
<p>This file contains a summary of changes to Haskell.nix and <code>nix-tools</code>
170170
that will impact users.</p>
171+
<h2 id="jul-3-2025"><a class="header" href="#jul-3-2025">Jul 3, 2025</a></h2>
172+
<p>Some time ago the behavior of <code>shellFor</code> changed so that the arguments
173+
are now checked against <code>modules/shell.nix</code>. This was done as part of a fix
174+
for bugs in the way <code>shellFor</code> arguments and project <code>shell</code> arguments
175+
interacted (both are now <code>modules</code> and the normal module merge rules apply).</p>
176+
<p>This means it is no longer possible to pass arbitrarily named arguments
177+
to <code>shellFor</code> in order to set environment variables.</p>
178+
<p>Instead of:</p>
179+
<pre><code>p.shellFor {
180+
FOO = "bar";
181+
}
182+
</code></pre>
183+
<p>Use:</p>
184+
<pre><code>p.shellFor {
185+
shellHook = ''
186+
export FOO="bar"
187+
'';
188+
}
189+
</code></pre>
190+
<p>or</p>
191+
<pre><code>(p.shellFor {}).overrideAttrs {
192+
FOO = "bar";
193+
}
194+
</code></pre>
171195
<h2 id="jan-29-2025"><a class="header" href="#jan-29-2025">Jan 29, 2025</a></h2>
172196
<p>Removed GHC &lt;9.6 from CI.</p>
173197
<p>The latest <code>nixpkgs-unstable</code> caused problems with</p>

print.html

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,17 +1901,49 @@ <h2 id="shellfor"><a class="header" href="#shellfor">shellFor</a></h2>
19011901
{ packages, withHoogle ? true, exactDeps ? false, ...}: ...
19021902
</code></pre>
19031903
<div class="table-wrapper"><table><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody>
1904+
<tr><td><code>name</code></td><td>String</td><td>Name of the derivation</td></tr>
19041905
<tr><td><code>packages</code></td><td>Function</td><td>Package selection function. It takes a list of <a href="reference/library.html#haskell-package">Haskell packages</a> and returns a subset of these packages.</td></tr>
19051906
<tr><td><code>components</code></td><td>Function</td><td>Similar to <code>packages</code>, by default all the components of the selected packages are selected.</td></tr>
19061907
<tr><td><code>additional</code></td><td>Function</td><td>Similar to <code>packages</code>, but the selected packages are built and included in <code>ghc-pkg list</code> (not just their dependencies).</td></tr>
19071908
<tr><td><code>withHoogle</code></td><td>Boolean</td><td>Whether to build a Hoogle documentation index and provide the <code>hoogle</code> command.</td></tr>
19081909
<tr><td><code>exactDeps</code></td><td>Boolean</td><td>Prevents the Cabal solver from choosing any package dependency other than what are in the package set.</td></tr>
1910+
<tr><td><code>allToolDeps</code></td><td>Boolean</td><td>Indicates if the shell should include all the tool dependencies of the haskell packages in the project.</td></tr>
19091911
<tr><td><code>tools</code></td><td>Function</td><td>AttrSet of tools to make available e.g. <code>{ cabal = "3.2.0.0"; }</code> or <code>{ cabal = { version = "3.2.0.0"; }; }</code>. If an AttrSet is provided for a tool, the additional arguments will be passed to the function creating the derivation for that tool. So you can provide an <code>index-state</code> or a <code>materialized</code> argument like that <code>{ cabal = { version = "3.2.0.0"; index-state = "2020-10-30T00:00:00Z"; materialized = ./cabal.materialized; }; }</code> for example. You can specify and materialize the version of hoogle used to construct the hoogle index by including something like <code>{ hoogle = { version = "5.0.17.15"; index-state = "2020-05-31T00:00:00Z"; materialized = ./hoogle.materialized; }</code>. Uses a default version of hoogle if omitted.</td></tr>
1910-
<tr><td><code>inputsFrom</code></td><td>List</td><td>List of other shells to include in this one. The <code>buildInputs</code> and <code>nativeBuildInputs</code> of each will be included using <a href="https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell">mkShell</a>.</td></tr>
1912+
<tr><td><code>packageSetupDeps</code></td><td>Boolean</td><td>Set this to <code>false</code> to exclude custom-setup dependencies.</td></tr>
1913+
<tr><td><code>enableDWARF</code></td><td>Boolean</td><td>Include debug info</td></tr>
19111914
<tr><td><code>crossPlatforms</code></td><td>Function</td><td>Platform selection function for cross compilation targets to support eg. <code>ps: with ps; [ghcjs mingwW64]</code> (see nixpkgs lib.systems.examples for list of platform names).</td></tr>
1912-
<tr><td><code>{ ... }</code></td><td>Attrset</td><td>All the other arguments are passed to <a href="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a>.</td></tr>
1915+
<tr><td><code>inputsFrom</code></td><td>List</td><td>List of other shells to include in this one. The <code>buildInputs</code> and <code>nativeBuildInputs</code> of each will be included using <a href="https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell">mkShell</a>.</td></tr>
1916+
<tr><td><code>shellHook</code></td><td>String</td><td>Bash statements that are executed when the shell starts.</td></tr>
1917+
<tr><td><code>buildInputs</code></td><td></td><td>Passed to <a href="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a> (via <a href="https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell">mkShell</a>).</td></tr>
1918+
<tr><td><code>nativeBuildInputs</code></td><td></td><td>Passed to <a href="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a> (via <a href="https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell">mkShell</a>).</td></tr>
1919+
<tr><td><code>passthru</code></td><td></td><td>Passed to <a href="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a> (via <a href="https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell">mkShell</a>).</td></tr>
19131920
</tbody></table>
19141921
</div>
1922+
<p>The arguments are checked using the module <code>modules/shell.nix</code>.</p>
1923+
<p>To set environment variables in the shell use:</p>
1924+
<pre><code> shellHook = ''
1925+
export FOO="bar"
1926+
'';
1927+
</code></pre>
1928+
<p>or</p>
1929+
<pre><code>(p.shellFor {}).overrideAttrs {
1930+
FOO = "bar";
1931+
}
1932+
</code></pre>
1933+
<p>The <code>shellFor</code> arguments can also be passed to the project <code>shell</code>
1934+
argument. For instance:</p>
1935+
<pre><code>(pkgs.haskell-nix.project {
1936+
...
1937+
shell.tools.cabal = {}
1938+
).shellFor {}
1939+
</code></pre>
1940+
<p>Is the same as:</p>
1941+
<pre><code>(pkgs.haskell-nix.project {
1942+
...
1943+
).shellFor {
1944+
tools.cabal = {}
1945+
}
1946+
</code></pre>
19151947
<p><strong>Return value</strong>: a derivation</p>
19161948
<blockquote>
19171949
<p>⚠️ <strong>Warning:</strong></p>
@@ -5946,6 +5978,30 @@ <h2 id="flakes"><a class="header" href="#flakes">Flakes</a></h2>
59465978
</code></pre>
59475979
<div style="break-before: page; page-break-before: always;"></div><p>This file contains a summary of changes to Haskell.nix and <code>nix-tools</code>
59485980
that will impact users.</p>
5981+
<h2 id="jul-3-2025"><a class="header" href="#jul-3-2025">Jul 3, 2025</a></h2>
5982+
<p>Some time ago the behavior of <code>shellFor</code> changed so that the arguments
5983+
are now checked against <code>modules/shell.nix</code>. This was done as part of a fix
5984+
for bugs in the way <code>shellFor</code> arguments and project <code>shell</code> arguments
5985+
interacted (both are now <code>modules</code> and the normal module merge rules apply).</p>
5986+
<p>This means it is no longer possible to pass arbitrarily named arguments
5987+
to <code>shellFor</code> in order to set environment variables.</p>
5988+
<p>Instead of:</p>
5989+
<pre><code>p.shellFor {
5990+
FOO = "bar";
5991+
}
5992+
</code></pre>
5993+
<p>Use:</p>
5994+
<pre><code>p.shellFor {
5995+
shellHook = ''
5996+
export FOO="bar"
5997+
'';
5998+
}
5999+
</code></pre>
6000+
<p>or</p>
6001+
<pre><code>(p.shellFor {}).overrideAttrs {
6002+
FOO = "bar";
6003+
}
6004+
</code></pre>
59496005
<h2 id="jan-29-2025"><a class="header" href="#jan-29-2025">Jan 29, 2025</a></h2>
59506006
<p>Removed GHC &lt;9.6 from CI.</p>
59516007
<p>The latest <code>nixpkgs-unstable</code> caused problems with</p>

reference/library.html

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,17 +476,49 @@ <h2 id="shellfor"><a class="header" href="#shellfor">shellFor</a></h2>
476476
{ packages, withHoogle ? true, exactDeps ? false, ...}: ...
477477
</code></pre>
478478
<div class="table-wrapper"><table><thead><tr><th>Argument</th><th>Type</th><th>Description</th></tr></thead><tbody>
479+
<tr><td><code>name</code></td><td>String</td><td>Name of the derivation</td></tr>
479480
<tr><td><code>packages</code></td><td>Function</td><td>Package selection function. It takes a list of <a href="#haskell-package">Haskell packages</a> and returns a subset of these packages.</td></tr>
480481
<tr><td><code>components</code></td><td>Function</td><td>Similar to <code>packages</code>, by default all the components of the selected packages are selected.</td></tr>
481482
<tr><td><code>additional</code></td><td>Function</td><td>Similar to <code>packages</code>, but the selected packages are built and included in <code>ghc-pkg list</code> (not just their dependencies).</td></tr>
482483
<tr><td><code>withHoogle</code></td><td>Boolean</td><td>Whether to build a Hoogle documentation index and provide the <code>hoogle</code> command.</td></tr>
483484
<tr><td><code>exactDeps</code></td><td>Boolean</td><td>Prevents the Cabal solver from choosing any package dependency other than what are in the package set.</td></tr>
485+
<tr><td><code>allToolDeps</code></td><td>Boolean</td><td>Indicates if the shell should include all the tool dependencies of the haskell packages in the project.</td></tr>
484486
<tr><td><code>tools</code></td><td>Function</td><td>AttrSet of tools to make available e.g. <code>{ cabal = "3.2.0.0"; }</code> or <code>{ cabal = { version = "3.2.0.0"; }; }</code>. If an AttrSet is provided for a tool, the additional arguments will be passed to the function creating the derivation for that tool. So you can provide an <code>index-state</code> or a <code>materialized</code> argument like that <code>{ cabal = { version = "3.2.0.0"; index-state = "2020-10-30T00:00:00Z"; materialized = ./cabal.materialized; }; }</code> for example. You can specify and materialize the version of hoogle used to construct the hoogle index by including something like <code>{ hoogle = { version = "5.0.17.15"; index-state = "2020-05-31T00:00:00Z"; materialized = ./hoogle.materialized; }</code>. Uses a default version of hoogle if omitted.</td></tr>
485-
<tr><td><code>inputsFrom</code></td><td>List</td><td>List of other shells to include in this one. The <code>buildInputs</code> and <code>nativeBuildInputs</code> of each will be included using <a href="https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell">mkShell</a>.</td></tr>
487+
<tr><td><code>packageSetupDeps</code></td><td>Boolean</td><td>Set this to <code>false</code> to exclude custom-setup dependencies.</td></tr>
488+
<tr><td><code>enableDWARF</code></td><td>Boolean</td><td>Include debug info</td></tr>
486489
<tr><td><code>crossPlatforms</code></td><td>Function</td><td>Platform selection function for cross compilation targets to support eg. <code>ps: with ps; [ghcjs mingwW64]</code> (see nixpkgs lib.systems.examples for list of platform names).</td></tr>
487-
<tr><td><code>{ ... }</code></td><td>Attrset</td><td>All the other arguments are passed to <a href="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a>.</td></tr>
490+
<tr><td><code>inputsFrom</code></td><td>List</td><td>List of other shells to include in this one. The <code>buildInputs</code> and <code>nativeBuildInputs</code> of each will be included using <a href="https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell">mkShell</a>.</td></tr>
491+
<tr><td><code>shellHook</code></td><td>String</td><td>Bash statements that are executed when the shell starts.</td></tr>
492+
<tr><td><code>buildInputs</code></td><td></td><td>Passed to <a href="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a> (via <a href="https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell">mkShell</a>).</td></tr>
493+
<tr><td><code>nativeBuildInputs</code></td><td></td><td>Passed to <a href="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a> (via <a href="https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell">mkShell</a>).</td></tr>
494+
<tr><td><code>passthru</code></td><td></td><td>Passed to <a href="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a> (via <a href="https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell">mkShell</a>).</td></tr>
488495
</tbody></table>
489496
</div>
497+
<p>The arguments are checked using the module <code>modules/shell.nix</code>.</p>
498+
<p>To set environment variables in the shell use:</p>
499+
<pre><code> shellHook = ''
500+
export FOO="bar"
501+
'';
502+
</code></pre>
503+
<p>or</p>
504+
<pre><code>(p.shellFor {}).overrideAttrs {
505+
FOO = "bar";
506+
}
507+
</code></pre>
508+
<p>The <code>shellFor</code> arguments can also be passed to the project <code>shell</code>
509+
argument. For instance:</p>
510+
<pre><code>(pkgs.haskell-nix.project {
511+
...
512+
shell.tools.cabal = {}
513+
).shellFor {}
514+
</code></pre>
515+
<p>Is the same as:</p>
516+
<pre><code>(pkgs.haskell-nix.project {
517+
...
518+
).shellFor {
519+
tools.cabal = {}
520+
}
521+
</code></pre>
490522
<p><strong>Return value</strong>: a derivation</p>
491523
<blockquote>
492524
<p>⚠️ <strong>Warning:</strong></p>

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)