From 201f59f0d12d6e2ba1122b9247d0d110cfdb3680 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Mon, 4 Apr 2016 19:45:42 -0500 Subject: [PATCH] shell.nix: optional profiling Run with `nix-shell -A env --arg profiling true` to enable profiling. --- shell-profiling.nix | 10 ---------- shell.nix | 10 +++++++++- 2 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 shell-profiling.nix diff --git a/shell-profiling.nix b/shell-profiling.nix deleted file mode 100644 index e6ceb80..0000000 --- a/shell-profiling.nix +++ /dev/null @@ -1,10 +0,0 @@ -with (import {}).pkgs; -let haskellPackages = pkgs.haskellPackages.override { - overrides = self: super: { - mkDerivation = args: super.mkDerivation (args // { - enableLibraryProfiling = true; - }); - }; - }; -in -(haskellPackages.callPackage ./. {}).env diff --git a/shell.nix b/shell.nix index f945183..4614f3e 100644 --- a/shell.nix +++ b/shell.nix @@ -1,8 +1,16 @@ -with (import {}); +{ nixpkgs ? import {}, profiling ? false }: + +with nixpkgs; + let inherit (pkgs.haskell) lib; haskellPackages = pkgs.haskell.packages.ghc7103.override { overrides = self: super: { + + mkDerivation = args: super.mkDerivation (args // { + enableLibraryProfiling = profiling; + }); + aeson = self.aeson_0_11_1_4; bifunctors = lib.dontHaddock self.bifunctors_5_2_1; comonad = lib.doJailbreak (lib.dontCheck super.comonad);