-
Couldn't load subscription status.
- Fork 166
Description
I have a project using reflex-platform with GHC 8.6.5. Therefore, this project requires haskell-language-server built with GHC 8.6.5. The haskell4nix documentation is very clear on how to install a specific version of HLS, and after looking around the reflex-platform source a bit, I managed to produce the following Nix expression:
{ system ? builtins.currentSystem }:
let config = {
packageOverrides = pkgs: {
haskell-language-server = pkgs.haskell-language-server.override { supportedGhcVersions = [ "865" ]; };
};
}; in
(import ./reflex-platform { inherit system config; }).project ({ pkgs, ... }: {
# snip
})Of course, I soon discovered that this doesn’t work: supplying config to ./reflex-platform only affects the expression resulting from the import, so installing HLS using nix-env -i haskell-language-server (inside nix-shell) still gets the wrong version, because it’s still looking in <nixpkgs>.
I then did some debugging with nix repl, and this produced the curious result that nixpkgs inside ./reflex-platform does not even appear to contain haskell-language-server:
$ nix repl
Welcome to Nix version 2.3.16. Type :? for help.
nix-repl> config = { packageOverrides = pkgs: { haskell-language-server = pkgs.haskell-language-server.override { supportedGhcVersions = [ "865" ]; }; }; }
nix-repl> system = builtins.currentSystem
nix-repl> rplat = import ./reflex-platform { inherit system config; }
nix-repl> rplat.nixpkgs.haskell-language-server
error: attribute 'haskell-language-server' missing, at (string):1:57
By contrast, it contained other packages I’d expect, for instance GCC:
nix-repl> rplat.nixpkgs.gcc
«derivation /nix/store/hhdqlmw9z0kmnhfcc48ng6bfd8ng4fy0-gcc-wrapper-9.3.0.drv»
And the global nixpkgs certainly contained HLS as expected:
nix-repl> (import <nixpkgs> {}).haskell-language-server
«derivation /nix/store/rg188igj8bscm9wml7riqyblyb2pdf0r-haskell-language-server-1.4.0.0.drv»
Furthermore, even if (import ./reflex-platform { inherit system config; }).nixpkgs were to contain HLS as expected, I’m not sure how I would even go about installing it within my Nix shell, given that said version of nixpkgs is accessible only within the function call in default.nix.
Thus I enquire: does there exist any way to install a specific version of HLS using reflex-platform? And if there is, could it please be added to the documentation? (I know it’s a beginner topic, but then again, HLS is likely one of the first things a beginner would want to install.)