When I provide the hlint
package together with haskell-language-server
I get this issue where the shell environment provides two versions of hlint
$ which -a hlint
/nix/store/3r7b7b6xnjah7f31cvlbc9y675jzl4zm-hlint-3.3.6/bin/hlint
/nix/store/nyqsxwgnrdvbyd18x7l2a6g52ggdjrkk-hlint-exe-hlint-3.4/bin/hlint
However this issue only occurs when providing HLS and hlint
together. If I remove haskell-language-server
I get
$ which -a hlint
/nix/store/nyqsxwgnrdvbyd18x7l2a6g52ggdjrkk-hlint-exe-hlint-3.4/bin/hlint
which is what I expected. So it seems like HLS is providing its own hlint
somehow? How can I prevent HLS from providing hlint
?
Flake to reproduce issue:
{
description = "HLS bug example";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
haskell-nix = {
inputs.flake-utils.follows = "flake-utils";
url =
"github:input-output-hk/haskell.nix?rev=00d857885906f77852b5fe18ecf0839ca3b5fd9f";
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, haskell-nix }:
flake-utils.lib.eachSystem (with flake-utils.lib.system; [ x86_64-linux x86_64-darwin aarch64-darwin ]) (system:
let ghc-version = "ghc8107";
pkgs = nixpkgs.legacyPackages.${system};
hpkgs = pkgs.haskell.packages.${ghc-version};
haskellNix = haskell-nix.legacyPackages.${system};
in {
devShell = hpkgs.shellFor {
packages = p : [];
nativeBuildInputs = with hpkgs; [
haskell-language-server
((haskellNix.haskell-nix.hackage-package {
name = "hlint";
version = "3.4";
compiler-nix-name = ghc-version;
index-state = "2022-05-05T00:00:00Z";
}).components.exes.hlint)
];
};
});
}