From e5ae4a8dc638ebe074243c7690cf128b664a1a9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Domen=20Ko=C5=BEar?= <domen@dev.si>
Date: Sun, 13 Oct 2019 09:31:45 +0200
Subject: [PATCH] ormolu: add from haskell package set

---
 pkgs/development/haskell-modules/configuration-nix.nix | 4 +++-
 pkgs/top-level/all-packages.nix                        | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix
index bcc7bb31386..ffdd1134e3b 100644
--- a/pkgs/development/haskell-modules/configuration-nix.nix
+++ b/pkgs/development/haskell-modules/configuration-nix.nix
@@ -97,7 +97,10 @@ self: super: builtins.intersectAttrs super {
   # profiling is disabled to allow C++/C mess to work, which is fixed in GHC 8.8
   cachix = disableLibraryProfiling super.cachix;
 
+  # avoid compiling twice by providing executable as a separate output (with small closure size)
   niv = enableSeparateBinOutput super.niv;
+  ormolu = enableSeparateBinOutput super.ormolu;
+  ghcid = enableSeparateBinOutput super.ghcid;
 
   # Ensure the necessary frameworks for Darwin.
   OpenAL = if pkgs.stdenv.isDarwin
@@ -109,7 +112,6 @@ self: super: builtins.intersectAttrs super {
     then addExtraLibrary super.proteaaudio pkgs.darwin.apple_sdk.frameworks.AudioToolbox
     else super.proteaaudio;
 
-  ghcid = enableSeparateBinOutput super.ghcid;
 
   hzk = overrideCabal super.hzk (drv: {
     preConfigure = "sed -i -e /include-dirs/d hzk.cabal";
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 7f5f911e670..1b7fa581207 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -10530,6 +10530,8 @@ in
 
   niv = haskellPackages.niv.bin;
 
+  ormolu = haskellPackages.ormolu.bin;
+
   capnproto = callPackage ../development/libraries/capnproto { };
 
   captive-browser = callPackage ../applications/networking/browsers/captive-browser { };