!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

684 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 infrastructure134 Servers

Load older messages


SenderMessageTime
9 Dec 2025
@morj:morj.menMorj joined the room.10:44:13
@andromeda:tchncs.deandromedaI lied I'm going to mess around with FFI to see if I can get RGFW working instead of GLFW :)18:57:59
@andromeda:tchncs.deandromedaOk so it's not working. I've been trying to troubleshoot for a while... maybe it's the way I've linked dependent libraries? Maybe it's a type error in my FFI? A brief look-around by someone smarter than me would be greatly appreciated... one again ignore the atrocities that are the build process... https://git.mtgmonkey.net/Andromeda/hs-rgfw22:01:48
@andromeda:tchncs.deandromedathe problem is that a window doesn't appear and window_shouldClose is immediately false, leading me to believe a type representation error or a windowing dependency error has occuredd22:03:19
10 Dec 2025
@andromeda:tchncs.deandromedaonce I remove the #define RGFW_WAYLAND it works for 1 frame on an X window manager (namely x monad)05:08:00
@andromeda:tchncs.deandromedaor better if I define ..WAYLAND and ..X11 then it automatically falls back05:12:45
@andromeda:tchncs.deandromedabut still only one frame05:12:56
@andromeda:tchncs.deandromedathis is really embarassing but I mixed up which exit code-style function return was good (==0) and bad (/=0)05:21:11
@mequbic:matrix.orgiqubic (she/her) So I have the Haskell package sbv listed as a dependency of my project in my Cabal file and then I'm pulling that in with cabal2Nix. For some reason, Nix is trying to pull in sbv-11.7 which is A) old and B) broken. Is there some way I can tell Nix to get version 13.3 for me? 09:52:54
@mequbic:matrix.orgiqubic (she/her)https://hackage.haskell.org/package/sbv09:52:59
@mequbic:matrix.orgiqubic (she/her)
{ pkgs ? import <nixpkgs> {} }:
let
  src = pkgs.nix-gitignore.gitignoreSource [] ./.;
  myPkg = pkgs.haskell.packages.ghc912.callCabal2nix "aoc25" src {};
in
pkgs.stdenv.mkDerivation {
  name = "aoc-shell";

  buildInputs = [
    myPkg.env.nativeBuildInputs

    pkgs.cabal-install
    pkgs.haskell.packages.ghc912.haskell-language-server

    pkgs.z3
  ];
}
09:53:12
@toonn:matrix.orgtoonn I think you'll have to override the package. Probably best to check the Nixpkgs manual because it's tricky. 10:04:22
@maralorn:maralorn.demaralorniqubic if none of your dependencies need sbv you can get away with putting the override in the empty attrset at the end of your line 4.10:05:34
@maralorn:maralorn.demaralornThere might be a ...ghc912.sbv_13_3 attribute which you can use.10:07:32
@maralorn:maralorn.demaralornAlthough it might also be broken without intervention.10:07:51
@toonn:matrix.orgtoonn (Highly recommend Haskell.nix for this use case.) 10:14:49
@maralorn:maralorn.demaralornI don’t think I agree. 😄10:22:45
@mequbic:matrix.orgiqubic (she/her) maralorn: No. None of the other packages I'm requiring in my Cabal file have sbv as a dependency. It's a top-level dependency, and not a transitive dependency. 10:44:45
@mequbic:matrix.orgiqubic (she/her) How would I use that in my dev environment? I'm using callCabal2Nix, so it might be a bit hard to override this. 10:45:27
@maralorn:maralorn.demaralornRedacted or Malformed Event10:59:07
@maralorn:maralorn.demaralorn
  1. Figure out which package there is. e.g. if your version of nixpkgs has sbv_13_0 or sbv_13_3.
11:00:09
@maralorn:maralorn.demaralorn
  1. adapt line 4 like this myPkg = pkgs.haskell.packages.ghc912.callCabal2nix "aoc25" src { sbv = pkgs.haskell.packages.ghc912.sbv_13_3; }
11:00:53
@maralorn:maralorn.demaralornIf you can’t find an sbv_x_y attribute to your liking you can instead use callHackage and if that doesn’t work callHackageDirect. Both are documented in the nixpkgs manual.11:01:49
@mequbic:matrix.orgiqubic (she/her)

Using pkgs.haskell.packages.ghc912.sbv_13_3 isn't working.

LATITUDE-NIXOS hs/aoc25 » nix-shell                                                                           1 ↵
fetching path input 'path:/nix/store/3w2nr2aq2gp76nb6lh1alx6h10mwvp5d-source'
error:
       … while evaluating an expression to select 'drvPath' on it
         at «internal»:1:552:
       … while evaluating strict
         at «internal»:1:552:
       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'outPath' missing
       at /nix/store/3w2nr2aq2gp76nb6lh1alx6h10mwvp5d-source/lib/deprecated/misc.nix:253:19:
          252|         startSet = map (x: {
          253|           key = x.outPath;
             |                   ^
          254|           val = x;

       note: trace involved the following derivations:
       derivation 'aoc-shell
11:07:12
@maralorn:maralorn.demaralornThat error message confuses me.11:08:10
@mequbic:matrix.orgiqubic (she/her)Why?11:08:27
@maralorn:maralorn.demaralornBecause it is not "has no attribute sbv_13_3".11:09:07
@maralorn:maralorn.demaralorn You can find possible sbv attributes by launching nix repl binding pkgs = import <nixpkgs> {} and then doing tabcompletion. 11:10:53
@mequbic:matrix.orgiqubic (she/her)Oh... I see what the issue is..11:15:39
@mequbic:matrix.orgiqubic (she/her)
{ pkgs ? import <nixpkgs> {} }:
let
  src = pkgs.nix-gitignore.gitignoreSource [] ./.;
  newSbv = { sbv = pkgs.haskell.packages.ghc912.sbv_12_2; };
  myPkg = pkgs.haskell.packages.ghc912.callCabal2nix "aoc25" src { sbv = newSbv; };
in
pkgs.stdenv.mkDerivation {
  name = "aoc-shell";

  buildInputs = [
    myPkg.env.nativeBuildInputs

    pkgs.cabal-install
    pkgs.haskell.packages.ghc912.haskell-language-server

    # pkgs.z3
  ];
}
11:15:49

Show newer messages


Back to Room ListRoom Version: 6