!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

744 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org147 Servers

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


SenderMessageTime
15 Sep 2025
@alex:tunstall.xyzAlex overrideCabal also works as with any other Haskell package because cabal2nix uses the same builder. 03:46:00
@bglgwyng:matrix.orgbglgwyng Yes. but haskellPackages.override { overrides = self: super: zlib = super.zlib.override { zlib = my-zlib}} doesn't work, since super.zlib is not the lambda argument, but the result of callPackages. So it's late. 03:54:48
@bglgwyng:matrix.orgbglgwyng From my understanding, when we use nixpkgs haskellPackages 03:55:27
@bglgwyng:matrix.orgbglgwyng * 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:matrix.orgbglgwyng
{
  "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:tunstall.xyzAlex

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

Show newer messages


Back to Room ListRoom Version: 6