From f50b22cf6e48730e56cc19eb8388816ed85bc200 Mon Sep 17 00:00:00 2001 From: YPares Date: Fri, 29 Apr 2016 16:40:46 +0200 Subject: [PATCH] Removing nix enabled by default when nix: section is present --- doc/nix_integration.md | 13 +++++++------ src/Stack/Types/Nix.hs | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/nix_integration.md b/doc/nix_integration.md index 46874b0035..af1575d3cd 100644 --- a/doc/nix_integration.md +++ b/doc/nix_integration.md @@ -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 @@ -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 diff --git a/src/Stack/Types/Nix.hs b/src/Stack/Types/Nix.hs index 2b10fde3b9..00c82749c2 100644 --- a/src/Stack/Types/Nix.hs +++ b/src/Stack/Types/Nix.hs @@ -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