summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--biz.nix35
-rw-r--r--default.nix3
-rw-r--r--overlays.nix35
3 files changed, 38 insertions, 35 deletions
diff --git a/biz.nix b/biz.nix
index f28e223..1194758 100644
--- a/biz.nix
+++ b/biz.nix
@@ -12,39 +12,6 @@ let
seq = ls: builtins.filter (x: x!= null) ls;
depsToPackageSet = packageSet: deps:
map (s: builtins.getAttr s packageSet) deps;
-
- # do the build...
-
- claySrc = pkgs.fetchFromGitHub {
- owner = "sebastiaanvisser";
- repo = "clay";
- rev = "cc7729b1b42a79e261091ff7835f7fc2a7ae3cee";
- sha256 = "1vd67976lvi5l4qq18zy6j44apynkl44ps04p8vwfx4gzr895dyp";
- };
-
- ghc865_ = pkgs.haskell.packages.ghc865.override (oldAttrs: {
- overrides = with pkgs.haskell.lib; self: super: {
- clay = self.callCabal2nix "clay" claySrc {};
- wai-middleware-metrics = dontCheck super.wai-middleware-metrics;
- };
- });
-
- # ghcjs-8.6.0.1
- ghcjs_ = pkgs.haskell.packages.ghcjs.override (oldAttrs: {
- overrides = with pkgs.haskell.lib; self: super: {
- QuickCheck = dontCheck super.QuickCheck;
- base-compat-batteries = dontCheck super.http-types;
- clay = dontCheck (self.callCabal2nix "clay" claySrc {});
- comonad = dontCheck super.comonad;
- http-types = dontCheck super.http-types;
- network-uri= dontCheck super.network-uri;
- scientific = dontCheck super.scientific; # takes forever
- servant = dontCheck super.servant;
- tasty-quickcheck = dontCheck super.tasty-quickcheck;
- time-compat = dontCheck super.time-compat;
- };
- });
-
in {
buildGhc = main:
let
@@ -57,7 +24,7 @@ in {
deps = lists.flatten (seq
(map (builtins.match "^-- : dep ([[:alnum:]._-]*)$")
(lines content)));
- ghc = ghc865_.ghcWithHoogle (hp: depsToPackageSet hp deps);
+ ghc = pkgs.haskell.packages.ghc865.ghcWithHoogle (hp: depsToPackageSet hp deps);
in stdenv.mkDerivation {
name = module;
version = "0";
diff --git a/default.nix b/default.nix
index 60b67b3..b15b925 100644
--- a/default.nix
+++ b/default.nix
@@ -1,6 +1,7 @@
let
nixpkgs-tar = builtins.fetchTarball (import ./nixpkgs.nix);
- nixpkgs = import "${nixpkgs-tar}" {};
+ overlay = import ./overlays.nix;
+ nixpkgs = import "${nixpkgs-tar}" { overlays = [ overlay ]; };
nixos = import "${nixpkgs-tar}/nixos";
# TODO(bsima): buildNixOS should be split into multiple functions that each
# return one thing, instead of a single function that returns multiple things
diff --git a/overlays.nix b/overlays.nix
new file mode 100644
index 0000000..5da2957
--- /dev/null
+++ b/overlays.nix
@@ -0,0 +1,35 @@
+self: super:
+
+let
+ claySrc = super.pkgs.fetchFromGitHub {
+ owner = "sebastiaanvisser";
+ repo = "clay";
+ rev = "cc7729b1b42a79e261091ff7835f7fc2a7ae3cee";
+ sha256 = "1vd67976lvi5l4qq18zy6j44apynkl44ps04p8vwfx4gzr895dyp";
+ };
+in {
+ haskell = super.haskell // {
+ packages = super.haskell.packages // {
+ ghc865 = super.haskell.packages.ghc865.override (old: {
+ overrides = with super.pkgs.haskell.lib; self: super: {
+ clay = self.callCabal2nix "clay" claySrc {};
+ wai-middleware-metrics = dontCheck super.wai-middleware-metrics;
+ };
+ });
+ ghcjs = super.haskell.packages.ghcjs.override (old: {
+ overrides = with super.haskell.lib; self: super: {
+ QuickCheck = dontCheck super.QuickCheck;
+ base-compat-batteries = dontCheck super.http-types;
+ clay = dontCheck (self.callCabal2nix "clay" claySrc {});
+ comonad = dontCheck super.comonad;
+ http-types = dontCheck super.http-types;
+ network-uri= dontCheck super.network-uri;
+ scientific = dontCheck super.scientific; # takes forever
+ servant = dontCheck super.servant;
+ tasty-quickcheck = dontCheck super.tasty-quickcheck;
+ time-compat = dontCheck super.time-compat;
+ };
+ });
+ };
+ };
+}