| 15 Sep 2025 |
bglgwyng | * From my understanding, when we use nixpkgs's haskellPackages, we usually deal with the result of callPackage cabal2nix-lambda rather than cabal2nix-lambda itself? | 03:56:00 |
bglgwyng | {
"zlib" = callPackage
({ mkDerivation, base, bytestring, QuickCheck, tasty
, tasty-quickcheck, zlib
}:
mkDerivation {
pname = "zlib";
version = "0.6.3.0";
sha256 = "1nh4xsm3kgsg76jmkcphvy7hhslg9hx1s75mpsskhi2ksjd9ialy";
revision = "5";
editedCabalFile = "0mj3f7ql54p0pfa5a6q4xv4ci8xf00616ls0nyadpmlqbb4qilwn";
libraryHaskellDepends = [ base bytestring ];
librarySystemDepends = [ zlib ];
testHaskellDepends = [
base bytestring QuickCheck tasty tasty-quickcheck
];
description = "Compression and decompression in the gzip and zlib formats";
license = lib.licenses.bsd3;
}) {inherit (pkgs) zlib;};
}
this is from hackage-pacakges.nix, and I'm not sure if I have any chance to override zlib when callPackage is already called.
| 03:57:11 |
Alex | So you want to be able to e.g. add extra arguments to the cabal2nix command?
IIRC that's possible with callCabal2nix and obviously if you implement the command yourself.
Overriding is trickier but should still be possible through overriding callCabal2nix (this isn't pretty).
I'm having trouble understanding why overriding the result is insufficient in your case. | 04:02:48 |
bglgwyng | Hmm, I tried such a thing splitmix = super.splitmix.override { testu01 = null; }; but it didn't work. | 04:06:32 |
bglgwyng | splitmix's definition is like
"splitmix" = callPackage
({ mkDerivation, async, base, ..., testu-01 }:
mkDerivation {
| 04:07:13 |
bglgwyng | To provide the context, I'm not using the vanilla haskellPackages, but the generated one for my purpose. | 04:08:38 |
bglgwyng | I was trying to handle "error: function 'anonymous lambda' called without required argument 'testu01'" this error message, by passing testu01 = null just like hackage-packages.nix does. | 04:09:24 |
bglgwyng | Of course I can do it with the cabal2nix expression, but I was wondering if I can do the same thing when callPackage is already applied. | 04:10:09 |
bglgwyng | If any approach simliar to splitmix = super.splitmix.override { testu01 = null; } is possible, it would be really helpful. | 04:10:53 |
bglgwyng | ah maybe I made a stupid mistake | 04:16:01 |
bglgwyng | it seems that the result of callCabal2Nix is not overridable, and I should wrap it manullay to make it overridable. | 04:16:42 |
bglgwyng | Yes, the vanilla pkgs.haskellPackages.* things are overridable and my callCabal2Nix results are not overridable. And I just found that make-package-set applies makeOverridable manullay. | 04:19:02 |