Simplify some things in default.nix

This commit is contained in:
John Wiegley 2018-04-16 15:10:47 -07:00
parent ea0942a86e
commit 136708ae8a

View file

@ -1,8 +1,6 @@
{ compiler ? "ghc822"
, doProfiling ? false
, doBenchmark ? false
, rev ? "ee28e35ba37ab285fc29e4a09f26235ffe4123e2"
, sha256 ? "0a6xrqjj2ihkz1bizhy5r843n38xgimzw5s2mfc42kk2rgc95gw5"
, nixpkgs ? import (builtins.fetchTarball {
@ -10,41 +8,31 @@
sha256 = sha256; }) { config.allowBroken = false; config.allowUnfree = true; }
}:
let
let inherit (nixpkgs) pkgs;
inherit (nixpkgs) pkgs;
haskellPackages = let hpkgs = pkgs.haskell.packages.${compiler}; in
hpkgs // {
mkDerivation = args: hpkgs.mkDerivation (args // {
enableLibraryProfiling = doProfiling;
enableExecutableProfiling = doProfiling;
});
};
pkg = haskellPackages.developPackage {
root = ./.;
overrides = with pkgs.haskell.lib; self: super: {
haskellPackages = pkgs.haskell.packages.${compiler}.override {
overrides = with pkgs.haskell.lib; self: super: rec {
serialise = dontCheck super.serialise;
};
source-overrides = {
insert-ordered-containers = pkgs.fetchFromGitHub {
owner = "mightybyte";
repo = "insert-ordered-containers";
rev = "87054c519b969b62131bcf7a183470d422cbb535";
sha256 = "0l0g6ns5bcrcaij0wbdgc04qyl9h0vk1kx9lkzdkwj9v51l26azm";
};
};
modifier = drv: pkgs.haskell.lib.overrideCabal drv (attrs: {
testHaskellDepends = attrs.testHaskellDepends ++
[
pkgs.nix
haskellPackages.hpack
haskellPackages.cabal-install
];
inherit doBenchmark;
});
};
in haskellPackages.developPackage {
root = ./.;
in pkg
source-overrides = {
};
modifier = drv: pkgs.haskell.lib.overrideCabal drv (attrs: {
testHaskellDepends = attrs.testHaskellDepends ++
[
pkgs.nix
haskellPackages.hpack
haskellPackages.cabal-install
];
enableLibraryProfiling = doProfiling;
enableExecutableProfiling = doProfiling;
inherit doBenchmark;
});
}