diff options
author | Ben Sima <ben@bsima.me> | 2020-10-13 11:57:29 -0400 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-10-13 12:02:32 -0400 |
commit | 1d92f4686c4803c802dce66804eba9ebe61efc1a (patch) | |
tree | caf95700e5c587d4908138004baf4273f6bf5466 /Biz/Bild/Overlay.nix | |
parent | dbea29d0c604c69968adbf658ca19a6cc207890d (diff) |
Move nix files into Biz.Bild namespace
Diffstat (limited to 'Biz/Bild/Overlay.nix')
-rw-r--r-- | Biz/Bild/Overlay.nix | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Biz/Bild/Overlay.nix b/Biz/Bild/Overlay.nix new file mode 100644 index 0000000..b8fe269 --- /dev/null +++ b/Biz/Bild/Overlay.nix @@ -0,0 +1,56 @@ +_: pkgs: + +let + simpleCabalBuilder = self: name: + self.callCabal2nix name pkgs.sources.${name} {}; + buildCabal = self: name: subdir: + if isNull subdir then + self.callCabal2nix name pkgs.sources.${name} {} + else + self.callCabal2nix name (pkgs.sources.${name} + "/${subdir}") {}; +in rec +{ + pinnedDeps = builtins.attrNames + (builtins.removeAttrs pkgs.sources ["__functor"]); + overridePinnedDeps = builder: pkgs.lib.genAttrs pinnedDeps builder; + + # Modifies a derivation with our source and version, keeping old build + # rules. This will fail if build steps have changed, or if no build + # rules are available upstream.. + overrideSource = name: pkgs.${name}.overrideAttrs (old: old // rec { + name = "${name}-${version}"; + version = pkgs.sources.${name}.version or pkgs.sources.${name}.rev; + src = pkgs.sources.${name}; + }); + + haskell = pkgs.haskell // { + packages = pkgs.haskell.packages // { + ghc865 = pkgs.haskell.packages.ghc865.override (old: { + overrides = with pkgs.pkgs.haskell.lib; self: super: + overridePinnedDeps (simpleCabalBuilder self) // { + acid-state = dontCheck super.acid-state; # mac: "too many open files" + servant-auth = buildCabal self "servant-auth" "servant-auth"; + wai-middleware-metrics = dontCheck super.wai-middleware-metrics; + }; + }); + ghcjs = pkgs.haskell.packages.ghcjs.override (old: { + overrides = with pkgs.haskell.lib; self: super: + overridePinnedDeps (simpleCabalBuilder self) // { + Glob = dontCheck super.Glob; + QuickCheck = dontCheck super.QuickCheck; + base-compat-batteries = dontCheck super.http-types; + clay = dontCheck super.clay; + comonad = dontCheck super.comonad; + jsaddle-warp = dontCheck (self.callCabal2nix "jsaddle-warp" "${pkgs.sources.jsaddle}/jsaddle-warp" {}); + http-types = dontCheck super.http-types; + network-uri= dontCheck super.network-uri; + scientific = dontCheck super.scientific; # takes forever + servant = dontCheck super.servant; + servant-auth = buildCabal self "servant-auth" "servant-auth"; + tasty-quickcheck = dontCheck super.tasty-quickcheck; + time-compat = dontCheck super.time-compat; + }; + }); + }; + }; +} |