-
Notifications
You must be signed in to change notification settings - Fork 245
How to have a properly setup haskell-language-server in nix-shell? #1012
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
Comments
The haskell4nix docs apply to the standard nixpkgs Haskell infrastructure, and not Haskell.nix. Add |
Thanks a lot @rvl! Did I miss something in the documentation I should have paid more attention to? Is there a way to know which |
There is a shellFor reference here: https://input-output-hk.github.io/haskell.nix/reference/library/#shellfor, but more user-guide-type documentation might help. |
That's probably the part which might cause confusion to unwary users like myself. Is there a place that could be linked to listing those special packages? |
Only custom-tools are |
OK. One last snag I am hitting is that |
Added #1015 to fix the |
Great! So does this mean i can install it elsewhere than from the tools?
Then I guess it will come naturally with the wrapper
Le dim. 24 janv. 2021 à 11:55, Hamish Mackenzie <notifications@github.com>
a écrit :
… Added #1015 <#1015> to
fix the -wrapper issue. Also haskell-language-server is in hackage now!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1012 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAJ2HJCZMCRAWNR5Q6V2BTS3P4BFANCNFSM4WNFQJPA>
.
|
Something like this should work now (with the current haskell.nix master): project.shellFor {
buildInputs = builtins.attrValues
(haskell-nix.hackage-package {
compiler-nix-name = "ghc8103";
name = "haskell-language-server";
version = "latest";
}).components.exes;
} With #1015 these will also work: project.shellFor {
tools = {
haskell-language-server = "latest";
haskell-language-server-wrapper = "latest";
};
} project.shellFor {
buildInputs = [
(haskell-nix.tool "ghc8103" "haskell-language-server" "latest")
(haskell-nix.tool "ghc8103" "haskell-language-server-wrapper" "latest")
];
} |
Awesome! I am afk but will give a try as soon as I can. Then I will only
have to figure out how to configure properly lsp-haskell in emacs :)
Le dim. 24 janv. 2021 à 12:15, Hamish Mackenzie <notifications@github.com>
a écrit :
… Something like this should work now (with the current haskell.nix master):
project.shellFor {
buildInputs = builtins.attrValues
(haskell-nix.hackage-package {
compiler-nix-name = "ghc8103";
name = "haskell-language-server";
version = "latest";
}).components.exes;
}
With #1015 <#1015>
these will also work:
project.shellFor {
tools = {
haskell-language-server = "latest";
haskell-language-server-wrapper = "latest";
};
}
project.shellFor {
buildInputs = [
(haskell-nix.tool "ghc8103" "haskell-language-server" "latest")
(haskell-nix.tool "ghc8103" "haskell-language-server-wrapper" "latest")
];
}
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1012 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAJ2HPUTUV44YAMZK7USXTS3P6ODANCNFSM4WNFQJPA>
.
|
So I tried the first solution
and it says
I guess I will have to wait for #1015 to reach master? |
Feel free to borrow the |
Thanks to the kind help from quite a few people I managed to solve that issue. I now have a working environment with emacs, LSP, HLS and Nix working together! There are still a few glitches and lot of stuff I don't really understand but at least I can load a file in Emacs and have the HLS installed in nix-shell give me errors and hints. |
Disclaimer: I am a total noob when it comes to nix + Haskell setup.
In order to learn how to use nix with Haskell, I have tried adding nix configuration to an existing simple package: https://github.com/abailly/hydra-sim/blob/master/shell.nix following the tutorial here: https://input-output-hk.github.io/haskell.nix/tutorials/getting-started/
After some fiddling I managed to have
nix-build
building the package, andnix-shell
dropping me into a properly configured shell. However, I am struggling with configuration of haskell-language-server, more specifically to get the correct version which should be HLS for 8.10.2 (the compile version defined indefault.nix
).I have tried to configure it following https://haskell4nix.readthedocs.io/nixpkgs-users-guide.html?highlight=language%20server#how-to-install-haskell-language-server with some adaptation:
but to no avail. What am I missing?
The text was updated successfully, but these errors were encountered: