Skip to content

Commit

Permalink
Merge pull request #2080 from commercialhaskell/nix-heuristic
Browse files Browse the repository at this point in the history
Removing nix enabled by default when nix: section is present
  • Loading branch information
mgsloan committed Apr 29, 2016
2 parents 44c4c20 + f50b22c commit dd98fbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions doc/nix_integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ With Nix enabled, `stack build` and `stack exec` will automatically
launch themselves in a local build environment (using `nix-shell`
behind the scenes).

If `enable:` is set to `false`, you can still build in a nix-shell by
passing the `--nix` flag to stack, for instance `stack --nix build`.
Passing any `--nix*` option to the command line will do the same.
If `enable:` is omitted or set to `false`, you can still build in a nix-shell by
passing the `--nix` flag to stack, for instance `stack --nix build`. Passing
any `--nix*` option to the command line will do the same.

**Known limitation on OS X:** currently, `stack --nix ghci` fails on
OS X, due to a bug in GHCi when working with external shared
Expand Down Expand Up @@ -162,9 +162,10 @@ Here is a commented configuration file, showing the default values:
```yaml
nix:
# true by default when the nix section is present. Set
# it to `false` to disable using Nix.
enable: true
# false by default. Must be present and set to `true` to enable Nix.
# You can set set it in your `$HOME/.stack/config.yaml` to enable
# Nix for all your projects without having to repeat it
# enable: true

# true by default. Tells Nix whether to run in a pure shell or not.
pure: true
Expand Down
2 changes: 1 addition & 1 deletion src/Stack/Types/Nix.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ data NixOptsMonoid = NixOptsMonoid
-- | Decode uninterpreted nix options from JSON/YAML.
instance FromJSON (WithJSONWarnings NixOptsMonoid) where
parseJSON = withObjectWarnings "NixOptsMonoid"
(\o -> do nixMonoidDefaultEnable <- pure True
(\o -> do nixMonoidDefaultEnable <- pure False
nixMonoidEnable <- o ..:? nixEnableArgName
nixMonoidPureShell <- o ..:? nixPureShellArgName
nixMonoidPackages <- o ..:? nixPackagesArgName
Expand Down

0 comments on commit dd98fbc

Please sign in to comment.