| 22 Jun 2025 |
FreeVariable | * maralorn Okay, so be it
{
inputs = {
nixpkgs.url = "https://github.com/NixOS/nixpkgs/archive/08f2208.tar.gz";
flake-utils.url = "github:numtide/flake-utils";
haskell-updates.url = "github:NixOS/nixpkgs/haskell-updates";
};
outputs = { self, nixpkgs, haskell-updates, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev: {
haskell-language-server =
haskell-updates.legacyPackages.${system}.haskellPackages.haskell-language-server;
})
];
};
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
stack
haskell.compiler.ghc9102
(haskell-language-server.override { supportedGhcVersions = [ "9102" ];})
haskellPackages.fourmolu
haskellPackages.hoogle
zlib
];
NIX_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.stdenv.cc.cc
pkgs.openssl
pkgs.zlib
];
NIX_LD = pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
};
}
);
}
error: function 'anonymous lambda' called with unexpected argument 'supportedGhcVersions'
| 09:42:01 |
Sand Witch | In reply to @setunset:matrix.org
maralorn Okay, so be it
{
inputs = {
nixpkgs.url = "https://github.com/NixOS/nixpkgs/archive/08f2208.tar.gz";
flake-utils.url = "github:numtide/flake-utils";
haskell-updates.url = "github:NixOS/nixpkgs/haskell-updates";
};
outputs = { self, nixpkgs, haskell-updates, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
(final: prev: {
haskell-language-server =
haskell-updates.legacyPackages.${system}.haskellPackages.haskell-language-server;
})
];
};
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
stack
haskell.compiler.ghc9102
(haskell-language-server.override { supportedGhcVersions = [ "9102" ];})
haskellPackages.fourmolu
haskellPackages.hoogle
zlib
];
NIX_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.stdenv.cc.cc
pkgs.openssl
pkgs.zlib
];
NIX_LD = pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
};
}
);
}
> error: function 'anonymous lambda' called with unexpected argument 'supportedGhcVersions'
You should use haskell-language-server from a different haskellPackages
Instead of using top-level haskell-language-server, consider haskell.packages.ghc9102.haskell-language-server
| 09:42:37 |
maralorn | Not really | 09:42:53 |
Sand Witch |
haskellPackages.fourmolu
BTW, fourmolu will not work with a new syntax too
| 09:43:52 |
FreeVariable | I mean, HLS is indeed the 2.11 version as I want. It's just the wrong built (ghc 9.8.4 when I want ghc 9.10.2) | 09:44:07 |
maralorn | The top level hls would also work with the supported versions override, but here you are using the haskell-language-server from haskellPackages which does not have that override | 09:44:30 |
maralorn | But @root:sandwitch.dev solution also works | 09:44:55 |
maralorn | @setunset:matrix.org you might also consider using haskellPackages.shellFor, it e.g. has a hoogle option | 09:46:02 |
Sand Witch | s/haskellPackages/haskell.packages.ghc9102 | 09:46:55 |
Sand Witch | haskellPackages correspond to a haskell.packages.ghcXYZ where XYZ is a current stackage LTS, I guess | 09:48:44 |