Hi Jeff,

I'm using a similar approach for non-Haskell packages.  However, for
Haskell packages it doesn't interact well with cabal2nix.  Hence my
question.  I have now solved it the following way in
`~/.nixpkgs/config.nix`:

    haskellPackageOverrides = self: super:
        let asDarcs = path:
                (self.callPackage (import path) {}).override (args: args // {
                    mkDerivation = expr:
                        args.mkDerivation (expr // {
                            src = nixos.pkgs.fetchdarcs { url = path; };
                        });
                });
        in {
            myxmonad   = self.callPackage <ertes-config/myxmonad> {};
            mytaffybar = self.callPackage <ertes-config/mytaffybar> {};
            testpkg1   = asDarcs <ertes-src/testpkg1/main>;
            testpkg2   = asDarcs <ertes-src/testpkg2/main>;
        };

The testpkg2 executable depends on the testpkg1 library, and it works.
The expressions are generated by cabal2nix, so no manual work is
involved.  So it seems to do exactly what it should.

> It's not specific to Haskell (and I haven't tried haskellng at all
> yet) but for personal packages I have mypkgs/<pkgname>/default.nix,
> and then a top-level mypkgs/default.nix:
>
> [...]
>
> I add that to my NIX_PATH so I can `import <mypkgs>` anywhere to get
> <nixpkgs> overridden with the stuff I'm working on.

Attachment: signature.asc
Description: PGP signature

_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to