!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
10 Dec 2025
@mequbic:matrix.orgiqubic (she/her)

maralorn: This seems to be working for me:

 GNU nano 8.7                                        shell.nix
{ pkgs ? import <nixpkgs> {} }:
let
  src = pkgs.nix-gitignore.gitignoreSource [] ./.;
  unbrokenSbv = pkgs.haskell.lib.compose.unmarkBroken pkgs.haskell.packages.ghc912.sbv_12_2;
  myPkg = pkgs.haskell.packages.ghc912.callCabal2nix "aoc25" src { sbv = pkgs.haskell.lib.compose.dontCheck unbro>
in
pkgs.stdenv.mkDerivation {
  name = "aoc-shell";

  buildInputs = [
    myPkg.env.nativeBuildInputs

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

    pkgs.z3
  ];
}
16:40:11
@mequbic:matrix.orgiqubic (she/her) *

maralorn: This seems to be working for me:

{ pkgs ? import <nixpkgs> {} }:
let
  src = pkgs.nix-gitignore.gitignoreSource [] ./.;
  unbrokenSbv = pkgs.haskell.lib.compose.unmarkBroken pkgs.haskell.packages.ghc912.sbv_12_2;
  myPkg = pkgs.haskell.packages.ghc912.callCabal2nix "aoc25" src { sbv = pkgs.haskell.lib.compose.dontCheck unbro>
in
pkgs.stdenv.mkDerivation {
  name = "aoc-shell";

  buildInputs = [
    myPkg.env.nativeBuildInputs

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

    pkgs.z3
  ];
}
16:40:26
@mequbic:matrix.orgiqubic (she/her) maralorn: And my solution to the Advent of Code puzzle last night was correct. 16:54:01
@mequbic:matrix.orgiqubic (she/her)When I built with tests, about 100 out of 80,000 failed. I guess that's why it's broken.16:54:28
@mequbic:matrix.orgiqubic (she/her) maralorn: Thanks for your help. I'll be going now! 17:07:38
@peddie:matrix.orgpeddielast I checked, the sbv tests failed because they are golden output tests and when nixpkgs runs them, it invokes the smt solver by its full path rather than just by executable name, so the exact output doesn't match? not sure how or whether this can be resolved. but I bet the tests are otherwise ok23:20:42
11 Dec 2025
@andromeda:tchncs.deandromedacabal2nix is to me actually quite pleasant05:25:53
@andromeda:tchncs.deandromedaso in Setup.hs, when I need to locate the Wayland protocols, I'm thinking I have a cabal flag to use Nix. In the Setup.hs file, if this nix flag is flown, the protocols will be found in the wayland-protocols nixpkg. Otherwise, they will be found in the 'normal' place. Does that track?05:52:59
@maralorn:maralorn.demaralorn custom setup.hs is not very popular 08:35:48
@maralorn:maralorn.demaralornWould probably be better if there were a proper way to discover Wayland-protocols but I have no clue if there is08:36:45
@maralorn:maralorn.demaralorn I.g. if it works it works 08:37:14
@magic_rb:matrix.redalder.orgmagic_rb Please dont call nix in setup.hs, you need to somehow get it in via env var 08:38:39
@magic_rb:matrix.redalder.orgmagic_rb Then you dont need a flag, if set NIX_WAYLAND_PROTOCOLS then 08:38:57
@magic_rb:matrix.redalder.orgmagic_rb Call nix in setup.hs will make it impossible to build in a nix sandbox without the recursive-nix feature 08:39:47
@magic_rb:matrix.redalder.orgmagic_rb * Calling nix in setup.hs will make it impossible to build in a nix sandbox without the recursive-nix feature 08:40:31
@magic_rb:matrix.redalder.orgmagic_rbOr some other container/vm fuckery08:40:40
@maralorn:maralorn.demaralornOh, I didn’t think of that possiblity. Yes, don’t call nix from Setup.hs, please.10:24:58
@maralorn:maralorn.demaralorn btw. andromeda what are you coding for wayland? I am curious. 10:25:25
@andromeda:tchncs.deandromedaI'm working on a hobby game engine, felt writers block on the actually productive part, and decided to replace the perfectly good and battle tested GLFW-b with ffi bindings to RGFW12:09:57
@andromeda:tchncs.deandromedaand I want it to be Waylvnd native rather than accessible through wayland satellite or something12:12:52
@andromeda:tchncs.deandromedabut honestlyayland's a pan in the kiester and that could be a later addition12:13:42
@maralorn:maralorn.demaralornI'd say enjoy that you don't have a manager with a deadline and do whatever is most fun/ the greatest learning experience. 😂12:17:11
@andromeda:tchncs.deandromedawait my brain is empty - if on a non-nix distro, I need to have setup.hs do wayland bs. I can otherwise just do it from the derivation 🤦‍♀️12:25:12
@andromeda:tchncs.deandromedaI used cabal2nix to get a derivation and it builds with callPackage but I want to run a pre configure hook. How ought I go about doing that?15:53:25
@andromeda:tchncs.deandromedafound it16:33:16
@andromeda:tchncs.deandromedapreBuild16:33:24
@andromeda:tchncs.deandromeda yesss it builds, finding the wayland headers and generating the code and everything, with both nix build on a Nix system and cabal build in a Kubuntu VM (after imperatively installing deps, ofc) 16:38:12
@andromeda:tchncs.deandromedahowever, cabal build fails when in a development shell on nix - a loss I'm willing to live with for now.16:52:48
@andromeda:tchncs.deandromeda My library builds, finding Wayland on Nix and non-Nix build systems! If anyone wants to take a peek: https://git.mtgmonkey.net/Andromeda/hs-rgfw 17:21:31
@andromeda:tchncs.deandromedatoo bad it can't do much atm17:21:52

There are no newer messages yet.


Back to Room ListRoom Version: 6