You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<tr><td><code>name</code></td><td>String</td><td>Name of the derivation</td></tr>
1904
1905
<tr><td><code>packages</code></td><td>Function</td><td>Package selection function. It takes a list of <ahref="reference/library.html#haskell-package">Haskell packages</a> and returns a subset of these packages.</td></tr>
1905
1906
<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>
1906
1907
<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>
1907
1908
<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>
1908
1909
<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>
1909
1911
<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 <ahref="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>
<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 <ahref="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 <ahref="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 <ahref="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a> (via <ahref="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 <ahref="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a> (via <ahref="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 <ahref="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a> (via <ahref="https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell">mkShell</a>).</td></tr>
1913
1920
</tbody></table>
1914
1921
</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>
1915
1947
<p><strong>Return value</strong>: a derivation</p>
<tr><td><code>name</code></td><td>String</td><td>Name of the derivation</td></tr>
479
480
<tr><td><code>packages</code></td><td>Function</td><td>Package selection function. It takes a list of <ahref="#haskell-package">Haskell packages</a> and returns a subset of these packages.</td></tr>
480
481
<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>
481
482
<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>
482
483
<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>
483
484
<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>
484
486
<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 <ahref="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>
<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 <ahref="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 <ahref="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 <ahref="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a> (via <ahref="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 <ahref="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a> (via <ahref="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 <ahref="https://nixos.org/nixpkgs/manual/#sec-using-stdenv"><code>mkDerivation</code></a> (via <ahref="https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell">mkShell</a>).</td></tr>
488
495
</tbody></table>
489
496
</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>
490
522
<p><strong>Return value</strong>: a derivation</p>
0 commit comments