From 7775a1a60ed1fd5472b180d7fc932ca70b07995d Mon Sep 17 00:00:00 2001
From: Jonathan Curran <joncfoo@gmail.com>
Date: Wed, 29 Nov 2017 14:52:29 -0700
Subject: [PATCH 1/2] purescript: fix build by overriding optparse-applicative
 dependency

---
 pkgs/development/haskell-modules/configuration-common.nix | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index ada9a9e53902..6d6c38a2a771 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -453,8 +453,10 @@ self: super: {
   # https://github.com/basvandijk/threads/issues/10
   threads = dontCheck super.threads;
 
-  # https://github.com/purescript/purescript/pull/3041
-  purescript = doJailbreak super.purescript;
+  # https://github.com/NixOS/nixpkgs/issues/32138
+  purescript = super.purescript.overrideScope (self: super: {
+    optparse-applicative = self.optparse-applicative_0_14_0_0;
+  });
 
   # Missing module.
   rematch = dontCheck super.rematch;            # https://github.com/tcrayford/rematch/issues/5

From 75b79fb5dbec67a12124ca58a9ffd9fcaea7c373 Mon Sep 17 00:00:00 2001
From: Jonathan Curran <joncfoo@gmail.com>
Date: Wed, 29 Nov 2017 15:47:44 -0700
Subject: [PATCH 2/2] Use override instead of overrideScope

---
 pkgs/development/haskell-modules/configuration-common.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index 6d6c38a2a771..84df4d1f0c4d 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -454,9 +454,9 @@ self: super: {
   threads = dontCheck super.threads;
 
   # https://github.com/NixOS/nixpkgs/issues/32138
-  purescript = super.purescript.overrideScope (self: super: {
+  purescript = super.purescript.override {
     optparse-applicative = self.optparse-applicative_0_14_0_0;
-  });
+  };
 
   # Missing module.
   rematch = dontCheck super.rematch;            # https://github.com/tcrayford/rematch/issues/5