!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

660 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://nixos.org/manual/nixpkgs/unstable/#haskell | Current PR: https://github.com/nixos/nixpkgs/pulls?q=is%3Apr+is%3Aopen+head%3Ahaskell-updates | Maintainer Docs: https://github.com/NixOS/nixpkgs/blob/haskell-updates/pkgs/development/haskell-modules/HACKING.md | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org | Merger Schedule: https://cloud.maralorn.de/apps/calendar/p/H6migHmKX7xHoTFa/dayGridMonth/now | Join #haskell.nix:libera.chat for question about the alternative haskell.nix infrastructure132 Servers

Load older messages


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
@root:sandwitch.devSand Witch* haskellPackages corresponds to a haskell.packages.ghcXYZ where XYZ is a current stackage LTS, I guess09:49:06
@setunset:matrix.orgFreeVariable Thank you very much maralorn and Sand Witch . It's building. Fingers crossed 09:49:47
@lambdatheultimatealias:matrix.orglambdatheultimatealiasQuick question. When the scripts run to update packages from Hackage, do they take the latest uploaded to Hackage or the latest that build from Hackage? I'm asking because my package depends on Amazonka which works on Nix but is out of date on Hackage, causing builds to fail there.15:36:51
@maralorn:maralorn.demaralornLatest uploaded15:37:43
@toonn:matrix.orgtoonn It's a Stackage LTS and then Hackage for everything else, to be more precise, no? 15:38:54
@maralorn:maralorn.demaralorn
In reply to @toonn:matrix.org
It's a Stackage LTS and then Hackage for everything else, to be more precise, no?
Yes, as described in the nixpkgs manual. Although it could possibly be more precise on the former question
15:45:34
@le:4d2.orglevin joined the room.18:36:28
23 Jun 2025
@sternenseemann:systemli.orgsterni lambdatheultimatealias: note that you can't draw any conclusions from nixpkgs about hackage since we regularly apply patches, modify constraints, build flags, test flags etc. 21:14:04
22 Jun 2025
@ners:nixos.devners

I'm trying to fix a broken package named ffmpeg-light. Here is what I have so far:

ffmpeg-light = lib.pipe hprev.ffmpeg-light [
  unmarkBroken
  doJailbreak
  (addSetupDepend prev.ffmpeg-full.lib)
  (drv: drv.overrideAttrs (attrs: { dontWrapQtApps = true; }))
];

However, the ffmpeg libs are still not found:

19:46:24
@ners:nixos.devnersRedacted or Malformed Event19:46:33
@ners:nixos.devners *

I'm trying to fix a broken package named ffmpeg-light. Here is what I have so far:

ffmpeg-light = lib.pipe hprev.ffmpeg-light [
  unmarkBroken
  doJailbreak
  (addSetupDepend prev.ffmpeg-full.lib)
  (drv: drv.overrideAttrs (attrs: { dontWrapQtApps = true; }))
];

However, the ffmpeg libs are still not found:

       > Error: Setup: Missing dependencies on foreign libraries:
       > * Missing (or bad) C libraries: avutil, avformat, avcodec, swscale, avdevice,
       > swresample
19:47:18
@emilazy:matrix.orgemily IIRC ffmpeg-light only works with ancient FFmpeg. 19:50:01
@emilazy:matrix.orgemily"Tested with FFmpeg 3.1 - 3.4.2"19:50:46
@ners:nixos.devnersThat may be so, but I'd still like to understand why it's not finding the libs I'm giving it.19:51:30
@ners:nixos.devners *

I'm trying to fix a broken package named ffmpeg-light. Here is what I have so far:

ffmpeg-light = lib.pipe hprev.ffmpeg-light [
  unmarkBroken
  doJailbreak
  (addSetupDepend prev.ffmpeg-full.dev)
  (drv: drv.overrideAttrs (attrs: { dontWrapQtApps = true; }))
];

However, the ffmpeg libs are still not found:

       > Error: Setup: Missing dependencies on foreign libraries:
       > * Missing (or bad) C libraries: avutil, avformat, avcodec, swscale, avdevice,
       > swresample
19:51:35
@ners:nixos.devners *

I'm trying to fix a broken package named ffmpeg-light. Here is what I have so far:

ffmpeg-light = lib.pipe hprev.ffmpeg-light [
  unmarkBroken
  doJailbreak
  (addSetupDepend prev.ffmpeg-full)
  (addPkgconfigDepend prev.ffmpeg-full.dev)
  (drv: drv.overrideAttrs (attrs: { dontWrapQtApps = true; }))
];

However, the ffmpeg libs are still not found:

       > Error: Setup: Missing dependencies on foreign libraries:
       > * Missing (or bad) C libraries: avutil, avformat, avcodec, swscale, avdevice,
       > swresample
19:54:00
@emilazy:matrix.orgemilyyou're not giving it an ancient FFmpeg is probably at least part of it19:54:45
@emilazy:matrix.orgemilywe're on FFmpeg 719:55:00
@ners:nixos.devnersBut how is its ancientness encoded in cabal?19:55:00
@ners:nixos.devnersI don't see the ffmpeg version encoded in the cabal file. It's asking for a certain set of pkgconfig libs, I'm giving it those libs.19:55:21

Show newer messages


Back to Room ListRoom Version: 6