Extend ghcHEAD derivation rather than make a new derivation (#486)
authorMatthew Pickering <matthewtpickering@gmail.com>
Tue, 5 Dec 2017 21:23:50 +0000 (21:23 +0000)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Tue, 5 Dec 2017 21:23:50 +0000 (21:23 +0000)
This allows you to use configurePhase/buildPhase as usual and
set the right configureFlags rather than end up with a broken
executable.

shell.nix

index e9a5ecc..f15f72b 100644 (file)
--- a/shell.nix
+++ b/shell.nix
@@ -16,6 +16,7 @@ let
            || baseName == ".stack-work"
            || baseName == "config.log"
            || baseName == "config.status"
            || baseName == ".stack-work"
            || baseName == "config.log"
            || baseName == "config.status"
+           || baseName == "shell.nix"
            || nixpkgs.lib.hasSuffix ".sh" baseName
            || !(nixpkgs.lib.cleanSourceFilter path type)) ;
 
            || nixpkgs.lib.hasSuffix ".sh" baseName
            || !(nixpkgs.lib.cleanSourceFilter path type)) ;
 
@@ -39,23 +40,12 @@ let
       }; };
 
 in
       }; };
 
 in
-
-  nixpkgs.stdenv.mkDerivation {
-    name = "ghc-dev";
-    buildInputs = [
+  nixpkgs.lib.overrideDerivation nixpkgs.haskell.packages.ghcHEAD.ghc
+    (drv: {
+      name = "ghc-dev";
+      buildInputs = drv.buildInputs ++ [
                     hadrianPackages.hadrian
                     hadrianPackages.hadrian
-                    nixpkgs.haskell.compiler.ghc821
-                    haskellPackages.alex
-                    haskellPackages.happy
-                    nixpkgs.python3
-                    nixpkgs.git
-                    nixpkgs.autoconf
-                    nixpkgs.automake
-                    nixpkgs.perl
-                    nixpkgs.gcc
-                    nixpkgs.python3Packages.sphinx
-                    nixpkgs.ncurses
-                    nixpkgs.m4
-                    nixpkgs.gmp
-                    nixpkgs.file ];
-  }
+                    nixpkgs.arcanist
+                    ];
+    })
+