From f1ef9440e02c34ba0bf3fd1231bd4aa5f229d185 Mon Sep 17 00:00:00 2001 From: Doug Beardsley Date: Fri, 6 Apr 2018 17:23:24 -0600 Subject: [PATCH] Revert change to default.nix --- default.nix | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index b04780a..bbca114 100644 --- a/default.nix +++ b/default.nix @@ -1,7 +1,32 @@ -{ pkgs ? import {} }: pkgs.haskellPackages.developPackage { +let + hostPkgs = import {}; + pinnedPkgs = hostPkgs.fetchFromGitHub { + owner = "NixOS"; + repo = "nixpkgs-channels"; + rev = "ee28e35ba37ab285fc29e4a09f26235ffe4123e2"; + sha256 = "0a6xrqjj2ihkz1bizhy5r843n38xgimzw5s2mfc42kk2rgc95gw5"; + }; + +in { nixpkgs ? import pinnedPkgs {} + , compiler ? "ghc822" + , doProfiling ? false + , doBenchmark ? false }: + +let + + 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 = ./.; source-overrides = { - unordered-containers = "0.2.9.0"; # Use a particular commit from github insert-ordered-containers = pkgs.fetchFromGitHub { owner = "mightybyte"; @@ -10,4 +35,10 @@ sha256 = "0l0g6ns5bcrcaij0wbdgc04qyl9h0vk1kx9lkzdkwj9v51l26azm"; }; }; -} + }; + + variant = if doBenchmark + then pkgs.haskell.lib.doBenchmark + else pkgs.lib.id; + +in variant pkg