[Nix-dev] Developing with older packages

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Mon Sep 8 18:03:00 CEST 2014


On 09/08/2014 04:56 PM, Richard Wallace wrote:
> 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
> 
> 
> 
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
> 

This looks as good of a solution as any other one could come up with. Is
there something you're dissatisfied with that you would like to have in
a ‘better’ solution?

-- 
Mateusz K.


More information about the nix-dev mailing list