!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

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

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


SenderMessageTime
15 Sep 2025
@bglgwyng:matrix.orgbglgwyngI haven't trie don the other platforms15:53:24
@sternenseemann:systemli.orgsterni

cabal2nix --system x86_64-linux https://hackage.haskell.org/package/splitmix-0.1.3.1.tar.gz gives me

{ mkDerivation, async, base, base-compat-batteries, bytestring
, containers, criterion, deepseq, fetchzip, HUnit, lib
, math-functions, process, random, template-haskell, test-framework
, test-framework-hunit, testu01, tf-random, vector
}:
mkDerivation {
  pname = "splitmix";
  version = "0.1.3.1";
  src = fetchzip {
    url = "https://hackage.haskell.org/package/splitmix-0.1.3.1.tar.gz";
    sha256 = "0mll5axdvh5wan6prh3v6l2n15xsj31ghi0g887ljpk515id5a2w";
  };
  libraryHaskellDepends = [ base deepseq ];
  testHaskellDepends = [
    async base base-compat-batteries bytestring containers deepseq
    HUnit math-functions process random template-haskell test-framework
    test-framework-hunit tf-random vector
  ];
  testSystemDepends = [ testu01 ];
  benchmarkHaskellDepends = [
    base containers criterion random tf-random
  ];
  description = "Fast Splittable PRNG";
  license = lib.licenses.bsd3;
}

So this looks fine.

15:54:59
@sternenseemann:systemli.orgsterniahh now I understand the issue.15:56:50
@sternenseemann:systemli.orgsterni

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

Show newer messages


Back to Room ListRoom Version: 6