!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

687 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 infrastructure135 Servers

Load older messages


SenderMessageTime
7 Jan 2026
@ners:nixos.devners Does anyone have experience with pkgsCross.ghcjs? I'm trying to build a package that indirectly depends on zlib, and getting the following error: no C compiler provided for this platform
I can trace the error to here: https://github.com/NixOS/nixpkgs/blob/492f8a5b3855f5d5f3fa4d096acb073ec7c86e17/pkgs/stdenv/cross/default.nix#L118
I think I should be able to use emscripten as a C compiler, any idea how I could wire that up to get zlib to build?
08:43:37
@acidbong:envs.netAcid Bong joined the room.15:34:54
@acidbong:envs.netAcid Bong evening. what's the current status of Cabal not seeing deps provided by shellFor? I see some suggest v1-* commands to workaround, but they both fail for me:
$ cabal v1-build
Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
[__0] trying: AoC-0.1.0.0 (user goal)
[__1] unknown package: matrix (dependency of AoC)
[__1] fail (backjumping, conflict set: AoC, matrix)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: AoC, matrix
Trying configure anyway.
Configuring AoC-0.1.0.0...
Error: [Cabal-8010]
Encountered missing or private dependencies:
    extra (missing), matrix (missing)

1 $ cabal v2-build
Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: AoC-0.1.0.0 (user goal)
[__1] unknown package: matrix (dependency of AoC)
[__1] fail (backjumping, conflict set: AoC, matrix)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: AoC, matrix
shell.nix seems to have the necessary tools
{
  pkgs ? import <nixpkgs> { },
}:
pkgs.haskellPackages.shellFor {
  name = "AoC";
  packages = h: [
    h.extra
    h.matrix
  ];
  nativeBuildInputs = [
    # Python
    # ...
    # Rust
    # ...
    # Haskell
    pkgs.cabal-install
    pkgs.haskell-language-server
    pkgs.haskellPackages.cabal-fmt
  ];
}
obviously generating a package recipe and building with Nix works, but i'm using the shell purely to cabal run or cabal repl the respective packages, which doesn't seem to work without fetching the deps from Hackage
18:00:43
@maralorn:maralorn.demaralorn Acid Bong: The problem is that the packages field in shellFor is not for listing dependencies but for listing the packages you want to be able to build within your shell. 18:40:11
@acidbong:envs.netAcid Bong ah, so a regular mkShell with ghc.withPackages in it is enough? 20:28:08
@maralorn:maralorn.demaralornThat would probably work, yes.20:29:20
@acidbong:envs.netAcid Bong bloo-dy-hell, that was so easy 🤦‍♂️ looks like the shellFor docs are misleading 20:33:57
@maralorn:maralorn.demaralornThere are many ways to hold this. Surprisingly many of them work but still most don’t. 😄20:37:03
8 Jan 2026
@acidbong:envs.netAcid Bong i wanna file a ticket about ghc.withPackages ignoring installDocumentation = false, but(1) there already exists one, but(2) the author mistook it for a NixOS issue (it's 316768). should we reformat the issue or open a new one? 20:12:50
9 Jan 2026
@sternenseemann:systemli.orgsterniIt got broken by a recent emscripten update again, just needs someone to look at config.log for ghc and see what goes wrong15:27:25
@sternenseemann:systemli.orgsterniThis will be addressed by https://github.com/NixOS/cabal2nix/pull/667. In theory we could also expand the manual exclude list in the meantime, but I think it's not really urgent at this point anymore.15:28:56
@ners:nixos.devnersI'd love to help, but don't know how.15:29:18
@sternenseemann:systemli.orgsterni ners: it would already be helpful if you could open an issue for the problem and obtain the contents of config.log (written by autoconf). You can get that by building witih --keep-failed. 15:31:18
@sternenseemann:systemli.orgsternialso link this piece of information, please: https://github.com/NixOS/nixpkgs/pull/466258#issuecomment-365107341615:32:43
@artem.types:matrix.orgArtem

i'm trying to build simple liquidhaskell app (https://github.com/ulysses4ever/liquid-haskell-demo) with

# default.nix
(pkgs.haskellPackages.callCabal2nix "liquid-haskell-app" ./liquid-haskell-app {}).overrideAttrs (old: {
  nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ pkgs.z3 ];
})

when I run nix-build I see that the builder runs haddock, which conflicts with liquid haskell (). I tried adding doHaddock = false; in the overrideAttrs but that didn't change a thing. What am I missing to turn off Haddock?

18:35:48
@sternenseemann:systemli.orgsterniyou need to use the override interface of the haskell builder, not overrideAttrs18:36:22
@sternenseemann:systemli.orgsternii.e. haskell.lib.compose.overrideCabal18:36:28
@andromeda:tchncs.deandromeda
In reply to @sternenseemann:systemli.org
ners: it would already be helpful if you could open an issue for the problem and obtain the contents of config.log (written by autoconf). You can get that by building witih --keep-failed.
most helpful thing I learned today: --keep-failed exists
19:02:01
@artem.types:matrix.orgArtem

sterni: i tried

pkgs.haskell.lib.overrideCabal (pkgs.haskellPackages.callCabal2nix "liquid-haskell-app" ./liquid-haskell-app {}) (old: {
  nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ pkgs.z3 ];
  doHaddock = false;
})

but that fails with a type error:

  error: function 'anonymous lambda' called with unexpected argument 'nativeBuildInputs'
19:06:06
@sternenseemann:systemli.orgsterniThat’s expected the dependency declarations are named different there to match cabal19:06:47
@sternenseemann:systemli.orgsterni you can look it up in the nixpkgs manual under “specifying dependencies” in the haskell section 19:07:13
@artem.types:matrix.orgArtemgreat, "buildTools" worked. Thanks a lot!19:16:47
@andromeda:tchncs.deandromedaliquid haskell looks really cool19:48:59

There are no newer messages yet.


Back to Room ListRoom Version: 6