[Nix-dev] Developing with older packages

Richard Wallace rwallace at thewallacepack.net
Mon Sep 8 17:56:13 CEST 2014


Hello,

I'm using nix-shell to setup a Haskell environment for development.  On a
project I ran into a problem recently, and I'm curious if there is a
common/preferred way of solving it.

The problem I ran into is that the project depends on the mongoDB 1.5
package.  The API changed drastically in 2.0 and we're not ready to
undertake the upgrade yet.  I think I can handle this by creating a nixpkgs
directory in the project, putting a mongoDB/default.nix file in there that
is setup for the version we need, then override it in our shell.nix file
like this:

let

   pkgs = import <nixpkgs> {};

   haskellPackages = pkgs.haskellPackages.override {

     extension = self: super: {
       mongoDB = self.callPackage nixpkgs/mongoDB {};
       ourkidsclass = self.callPackage ./. {};

     };

   };

Is this a reasonable approach? Is there a better way?

Thanks,
Rich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140908/fdfebe48/attachment-0001.html 


More information about the nix-dev mailing list