Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start fails on Nixos #455

Closed
sir4ur0n opened this issue Jul 20, 2019 · 6 comments
Closed

Start fails on Nixos #455

sir4ur0n opened this issue Jul 20, 2019 · 6 comments

Comments

@sir4ur0n
Copy link
Contributor

Hi,

I just recently started using Nixos and tested my workflow with Intellij and Haskell on it.
When importing for the first time a Haskell project in Intellij, it installs many tools using this command:

~/.nix-profile/bin/stack -j1 --stack-root ~/.cache/intellij-haskell/lts-13 --resolver lts-13 --local-bin-path ~/.cache/intellij-haskell/lts-13/bin install hoogle

However this fails as it requires Zlib which requires special Stack integration.
The command is successful if I manually type it in a terminal and add --nix-packages "zlib" option to it:

~/.nix-profile/bin/stack --nix-packages "zlib" -j1 --stack-root ~/.cache/intellij-haskell/lts-13 --resolver lts-13 --local-bin-path ~/.cache/intellij-haskell/lts-13/bin install hoogle

Have I missed something (this is completely possible as I'm a huge noob in Nix/Nixos)? Or is something missing for Nixos use?

Note, in my project stack.yaml it was correctly configured:

resolver: lts-13.26
packages:
  - .
nix:
  enable: true
  packages: 
    - zlib

Cheers!

@friedbrice
Copy link
Contributor

I think your configuration is correct; I think the problem might be an oversight in the tools-creation logic. As a stopgap, you could use a feature coming in the next release that will allow you to build your tools separately and specify their paths directly in the plugin options.

@friedbrice
Copy link
Contributor

Here's the PR if you'd like to follow it: #454 (comment)

@rikvdkleij
Copy link
Owner

Stack's nix integration is not without flaws.

You can try to add zlib to to shell.nix or default.nix to be sure of zlib in the nix-shell.

I have not so good experience with stack it's nix integration, especially not on macOS.
See
commercialhaskell/stack#4406
commercialhaskell/stack#4329

Btw, you can better use nix and cabal new style. But yes, the plugin does not support that yet. It's on my wish list and did already some preparations.

@rikvdkleij
Copy link
Owner

Please reopen if still an issue.

@sir4ur0n
Copy link
Contributor Author

I guess this can be closed as we now can explicitly pass tool paths rather than relying on the plugin installing them, thank you 😄

@rikvdkleij
Copy link
Owner

Thanks for the confirmation.

Eventually the plugin should support Cabal/Nix projects but that's a separate issue 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants