!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

745 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org149 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
22 Jun 2025
@setunset:matrix.orgFreeVariable *

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
@root:sandwitch.devSand 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:maralorn.demaralornNot really09:42:53
@root:sandwitch.devSand Witch

haskellPackages.fourmolu

BTW, fourmolu will not work with a new syntax too

09:43:52
@setunset:matrix.orgFreeVariableI 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:maralorn.demaralornThe 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 override09:44:30
@maralorn:maralorn.demaralorn But @root:sandwitch.dev solution also works 09:44:55
@maralorn:maralorn.demaralorn @setunset:matrix.org you might also consider using haskellPackages.shellFor, it e.g. has a hoogle option 09:46:02
@root:sandwitch.devSand Witchs/haskellPackages/haskell.packages.ghc910209:46:55
@root:sandwitch.devSand WitchhaskellPackages correspond to a haskell.packages.ghcXYZ where XYZ is a current stackage LTS, I guess09:48:44

Show newer messages


Back to Room ListRoom Version: 6