!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

724 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/144 Servers

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


SenderMessageTime
15 Sep 2025
@sternenseemann:systemli.orgsterni (he/him)ahh now I understand the issue.15:56:50
@sternenseemann:systemli.orgsterni (he/him)

The problem with override is that it depends on initially computing the derivation successfully. This doesn't work if an argument is missing which is the case here with testu01. That's why callCabal2nix has a third argument to pass in arguments (which can also act as an override at the definition site). So you want to do:

(pkgs.haskellPackages.callCabal2nix "splitmix" (builtins.fetchTarball "https://hackage.haskell.org/package/splitmix-0.1.3.1.tar.gz") { testu01 = null /* just pass something */; }).override { testu01 = /* later we can pass something else: */ my-pkg; } 
15:59:14
@bglgwyng:matrix.orgbglgwyngAh I see16:06:43
@bglgwyng:matrix.orgbglgwyngThanks!16:06:46
@bglgwyng:matrix.orgbglgwyng One thing annoying is that I can investigate the argments with builtins.functionArgs (pkgs.callCabal2nix name src) 16:13:54
@bglgwyng:matrix.orgbglgwyngMaybe it's because wrapped? I think I can find how to fix it16:14:12
@keypusher:matrix.orgkeypusherSo going the addBuildTools route will require me to build wo using callCabal2Nix then?16:19:31
@maralorn:maralorn.demaralornI am missing a bit of context, but I don’t think so. Both functions are compatible. First call callCabal2Nix then apply addBuildTools to the result of the function.16:33:23
@keypusher:matrix.orgkeypusherOh ok. I'll try that16:34:22
@keypusher:matrix.orgkeypusherYou made my day. 4 hours of struggling just came to an end. My nix intuition is lacking.16:36:43

Show newer messages


Back to Room ListRoom Version: 6