config: remove nix.enable heuristic #1924
Comments
Interesting! It makes some good sense to me to have a mode where nix isn't strictly required. Perhaps that mode would even be a good default. Pinging @YPares |
I don't understand why Nix can be enabled/disabled from |
And I've had to figure this out the hard way... yesodweb/wai#520 |
Sorry for the late answer. @chris-martin @zimbatm Indeed when I included this heuristic I didn't think about your use case. |
@borsboom Do you think the heuristic should be removed then? |
Under what circumstance would I not want to enable Nix when building a Stack project on NixOS? I've encountered very few nontrivial projects that can build successfully without including a zlib Nix dependency. |
It seems to me that a more correct heuristic would be to enable nix when both of these conditions are true:
|
If your dependencies are already installed via 2016-03-23 10:27 GMT+01:00 Chris Martin notifications@github.com:
|
Alright, I just want to make it clear that I don't think I will ever run stack on this machine without passing |
Another solution would be to tweak the default to only be true if both the nix section is non-empty and the |
@borsboom can you re-open the ticket please ? The issue is still valid and we are still discussing potential implementations. |
@zimbatm @chris-martin I'm not really in favor of this kind of tests, as they can lead to unexpected behaviours depending on how you think your system is configured. @mgsloan My only concern with that is that it makes nix config behaviour depart from the equivalent docker config behaviour. This might not be a bad thing, though, as this kind of heuristics should be told by usage, and maybe what is relevant for docker isn't for nix. What do you think about that? |
PR has been merged, and no compatibility problems arose, so I'm closing the issue. |
I have a project which gets compiled by nix and Ubuntu users. Both set of users expect to be able to type
stack build
and have the right thing to happen.My current stack.yaml:
I am forced to set
nix.enable
tofalse
for Ubuntu users. If I don't set to anything the current heuristic is to set it to true because of the nix.packages existing.From the doc, and this is what I have witnessed too:
On nix I was hoping to set
nix.enalbe
totrue
in~/.stack/config.yaml
but the per-project config has precedence over the global config (which makes sense to me).So currently there is no way to support my scenario. While I see that the heuristic is trying to be helpful I think that it's counter-productive and should be removed.
The text was updated successfully, but these errors were encountered: