[Nix-dev] Overriding a Haskell package can't be that hard...

Cody Goodman codygman.consulting at gmail.com
Fri Jun 24 05:57:28 CEST 2016


I was trying to use the cassandra-thrift haskell package and there was a
bug in one if it's dependencies, thrift. I fixed the bug in thrift and then
went to the nix haskell guide to find out how to override "thrift" with my
bugfixed version.

I came up with this from the haskell guide (
http://nixos.org/nixpkgs/manual/#how-to-build-projects-that-depend-on-each-other
):

{ pkgs }: {
packageOverrides = super: let self = super.pkgs; in
  {
    haskellPackages = super.haskellPackages.override {
      overrides = self: super: {
        thrift = self.callPackage /home/cody/sources/thrift/lib/hs {};
      };
    };
  };

  allowUnfree = true;
  firefox = {
     enableGoogleTalkPlugin = true;
     enableAdobeFlash = true;
  };

and then finally tried the example from ocharle's wiki on nix/haskell,
which involved putting the override in shell.nix like below:

with (import <nixpkgs> {}).pkgs;
let modifiedHaskellPackages = haskellPackages.override {
      overrides = self: super: {
        thrift = self.callPackage /home/cody/sources/thrift/lib/hs {};
      };
    };
in modifiedHaskellPackages.hscassandra.env

I'm a little dismayed since I even went through all 19 or so of the nix
pills(
http://lethalman.blogspot.com/2014/07/nix-pill-1-why-you-should-give-it-try.html)
thinking I just needed to brush up on nix.

If someone could also explain these snippets and how they work in detail or
differently than the resources I've looked at many times:

http://nixos.org/nixpkgs/manual/#how-to-build-projects-that-depend-on-each-other
http://lethalman.blogspot.com/2014/07/nix-pill-1-why-you-should-give-it-try.html
http://wiki.ocharles.org.uk/Nix#multiple-project-usage

If possible, any example git repositories with multiple haskell
projects/overrides would be amazing.

Thank you all for your time.

Sincerely,

Cody Goodman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160623/7f6bb56e/attachment.html>


More information about the nix-dev mailing list