Jonathan
Jonathan

Reputation: 11321

How can I disable testing for a Haskell package in Nix?

I'm trying to get a development environment going for Haskell, using Nix. I have a default.nix that just refers to my .cabal file for the list of packages. But one package I want to use, numhask-space, won't build, because the tests are failing. So I'm trying to override it and skip the tests.

Here's my default.nix:

# default.nix
let
  pkgs = import <nixpkgs> { };
in
  pkgs.haskellPackages.developPackage {
    root = ./.;
    modifier = drv:
      pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
        [ cabal-install
          ghcid
        ]);
    source-overrides = {
      numhask-space = pkgs.haskell.lib.dontCheck pkgs.haskellPackages.numhask-space;
        };
  }

But I must not be doing this right, because I get the error:

cabal2nix: user error (Failed to fetch source. Does this source exist? Source {sourceUrl = "/nix/store/w3pcvlj7b0k44v629k00kw2b0k86fcyj-numhask-space-0.3.0", sourceRevision = "", sourceHash = Guess "", sourceCabalDir = ""})

In short, how can I override this haskell package so that it doesn't run the tests, and I can install it in my development environment?

Upvotes: 5

Views: 1821

Answers (1)

kirelagin
kirelagin

Reputation: 13616

source-overrides overrides sources of the packages, that is, literally, the src attributes, rather than packages as a whole. You should use the overrides argument instead:

    overrides = self: super: {
      numhask-space = pkgs.haskell.lib.dontCheck super.numhask-space;
    };

Upvotes: 6

Related Questions