[Nix-dev] A Journey into the Haskell NG infrastructure: Part I

Peter Simons simons at cryp.to
Sat Jan 10 10:06:40 CET 2015


Hi Eric,

 > error: anonymous function [...] called with unexpected argument ‘extension’ [...]

the 'extension' argument has been renamed 'overrides'. The semantics are the
same, just the name is different.

Generally speaking, you have two options for messing with the Haskell package
set. You can override the 'overrides' argument via ~/.nixpkgs/config.nix:

 | {
 |   packageOverrides = super: let self = super.pkgs; in
 |   {
 |     haskellngPackages = super.haskellngPackages.override {
 |       overrides = self: super: {
 |         my-secret-package = self.callPackage ./my-secret-package.nix {};
 |       };
 |     };
 |   };
 | }

This works for any package set, i.e. you can modify haskell-ng.packages.ghcHEAD
the same way.

If you want to change the only contents of haskellngPackages, then a simpler
alternative is to define a 'haskellPackageOverrides' attribute like this one:

 | {
 |   haskellPackageOverrides = self: super: {
 |     yo = self.callPackage ./hsyslog.nix {};
 |   };
 | }

Note, however, that your old cabal2nix-generated builds will not work in the NG
package set. You'll have to re-generate them with the latest version of
cabal2nix, which you can install by running:

  nix-env -iA haskellngPackages.cabal2nix

I hope this helps,
Peter



More information about the nix-dev mailing list