@@ -115,6 +115,12 @@ With Nix enabled, `stack build` and `stack exec` will automatically
115
115
launch themselves in a local build environment (using `nix-shell`
116
116
behind the scenes).
117
117
118
+ ` stack setup` will start a nix-shell, so it will gather all the required
119
+ packages, but given nix handles GHC installation, instead of stack, this will
120
+ happen when running `stack build` if no setup has been performed
121
+ before. Therefore it is not longer necessary to run `stack setup` unless you
122
+ want to cache a GHC installation before running the build.
123
+
118
124
If `enable:` is omitted or set to `false`, you can still build in a nix-shell by
119
125
passing the `--nix` flag to stack, for instance `stack --nix build`. Passing
120
126
any `--nix*` option to the command line will do the same.
@@ -125,13 +131,18 @@ libraries.
125
131
126
132
# ## The Nix shell
127
133
128
- By default, stack will run the build in a pure Nix build environment
129
- (or *shell*), which means the build should fail if you haven't
130
- specified all the dependencies in the `packages:` section of the
131
- ` stack.yaml` file, even if these dependencies are installed elsewhere
132
- on your system. This behaviour enforces a complete description of the
133
- build environment to facilitate reproducibility. To override this
134
- behaviour, add `pure : false` to your `stack.yaml` or pass the
134
+ By default, stack will run the build in a *pure* Nix build environment (or
135
+ *shell*), which means two important things:
136
+
137
+ - basically **no environment variable will be forwarded** from your user session
138
+ to the nix-shell (variables like `HTTP_PROXY` or `PATH` notably will not be
139
+ available),
140
+ - the build should fail if you haven't specified all the dependencies in the
141
+ ` packages:` section of the `stack.yaml` file, even if these dependencies are
142
+ installed elsewhere on your system. This behaviour enforces a complete
143
+ description of the build environment to facilitate reproducibility.
144
+
145
+ To override this behaviour, add `pure : false` to your `stack.yaml` or pass the
135
146
` --no-nix-pure` option to the command line.
136
147
137
148
**Note:** On macOS shells are non-pure by default currently. This is
0 commit comments