Skip to content

Commit fa92889

Browse files
YParesmboes
authored andcommitted
Nix: Doc about GHC version updated. Error when asking for GHCJS
Changelog updated too
1 parent 186287c commit fa92889

3 files changed

Lines changed: 17 additions & 15 deletions

File tree

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Other enhancements:
1818

1919
* Add the ability to explictly specify a gcc executable.
2020
[#593](https://github.com/commercialhaskell/stack/issues/593)
21+
* Nix: No longer uses LTS mirroring in nixpkgs. Gives to nix-shell a derivation
22+
like `haskell.compiler.ghc801`
23+
See [#2259](https://github.com/commercialhaskell/stack/issues/2259)
2124

2225
Bug fixes:
2326

doc/nix_integration.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,37 +40,36 @@ a version of GHC matching the configured resolver. Enabling Nix
4040
support means packages will always be built using a GHC available
4141
inside the shell, rather than your globally installed one if any.
4242

43-
Note that in this mode `stack` can use only those resolvers that have
44-
already been mirrored into the Nix package repository. The
45-
[Nixpkgs master branch](https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/haskell-modules)
46-
usually picks up new resolvers such as Stackage nightlies and LTS
47-
versions within two or three days. Then it takes another two or three
43+
Note that in this mode `stack` can use only GHC versions than have
44+
already been mirrored into the Nix package repository.
45+
The [Nixpkgs master branch](https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/haskell-modules)
46+
usually picks up new versions quickly, but it takes two or three
4847
days before those updates arrive in the `unstable` channel. Release
4948
channels, like `nixos-15.09`, receive those updates only
5049
occasionally -- say, every two or three months --, so you should not
51-
expect them to have the latest resolvers available. Fresh Nix installs
50+
expect them to have the latest compiler available. Fresh NixOS installs
5251
use a release version by default.
5352

54-
To know for sure whether a given resolver as available on your system,
53+
To know for sure whether a given compiler is available on your system,
5554
you can use the command
5655

5756
```sh
58-
$ nix-env -f "<nixpkgs>" -qaP -A haskell.packages.lts-3_13.ghc
59-
haskell.packages.lts-3_13.ghc ghc-7.10.2
57+
$ nix-env -f "<nixpkgs>" -qaP -A haskell.compiler.ghc801
58+
haskell.compiler.ghc801 ghc-8.0.1
6059
```
6160

6261
to check whether it's available. If Nix doesn't know that resolver
6362
yet, then you'll see the following error message instead:
6463

6564
```sh
66-
$ nix-env -f "<nixpkgs>" -qaP -A haskell.packages.lts-3_99.ghc
67-
error: attribute ‘lts-3_99’ in selection path ‘haskell.packages.lts-3_99.ghc’ not found
65+
$ nix-env -f "<nixpkgs>" -qaP -A haskell.compiler.ghc999
66+
error: attribute ‘ghc999’ in selection path ‘haskell.compiler.ghc999’ not found
6867
```
6968

70-
You can list all known Haskell package sets in Nix with the following:
69+
You can list all known Haskell compilers in Nix with the following:
7170

7271
```sh
73-
$ nix-instantiate --eval -E "with import <nixpkgs> {}; lib.attrNames haskell.packages"
72+
$ nix-instantiate --eval -E "with import <nixpkgs> {}; lib.attrNames haskell.compiler"
7473
```
7574

7675
Alternatively, install `nix-repl`, a convenient tool to explore
@@ -86,7 +85,7 @@ autocomplete:
8685

8786
```sh
8887
nix-repl> :l <nixpkgs>
89-
nix-repl> haskell.packages.lts-<Tab>
88+
nix-repl> haskell.compiler.ghc<Tab>
9089
```
9190

9291
You can type and evaluate any nix expression in the nix-repl, such as

src/Stack/Config/Nix.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ nixCompiler compilerVersion =
5757
(fixMinor (versionText v)))
5858
in case compilerVersion of
5959
GhcVersion v -> nixCompilerFromVersion v
60-
_ -> T.pack "ghc"
60+
_ -> error "Only GHC is supported by now by stack --nix"
6161

6262
-- Exceptions thown specifically by Stack.Nix
6363
data StackNixException

0 commit comments

Comments
 (0)