diff options
author | Ben Sima <ben@bsima.me> | 2020-05-02 15:39:07 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-05-02 15:39:07 -0700 |
commit | b8c33100286ab307f46d3dfe7adf44008cc59d3e (patch) | |
tree | 95a822b141fd2e08c03a8eb90dc72121c22ad0a4 /nix/haskell-overlay.nix | |
parent | 93718f88d65d1fc4322fbd42804dfabc9128e4cd (diff) |
Auto-overlay niv sources
This is somewhat experimental, the idea is automatically set the sources
from my niv pinned deps. It seems to work, so I'll keep at it and see if
I can improve it as issues come up.
Diffstat (limited to 'nix/haskell-overlay.nix')
-rw-r--r-- | nix/haskell-overlay.nix | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/nix/haskell-overlay.nix b/nix/haskell-overlay.nix index e384b4f..1afea87 100644 --- a/nix/haskell-overlay.nix +++ b/nix/haskell-overlay.nix @@ -1,24 +1,26 @@ -_: nixpkgs: +_: pkgs: +let + cabalBuilder = self: name: self.callCabal2nix name pkgs.sources.${name} {}; +in { - haskell = nixpkgs.haskell // { - packages = nixpkgs.haskell.packages // { - ghc865 = nixpkgs.haskell.packages.ghc865.override (old: { - overrides = with nixpkgs.pkgs.haskell.lib; self: super: { - clay = self.callCabal2nix "clay" nixpkgs.sources.clay {}; - miso = self.callCabal2nix "miso" nixpkgs.sources.miso {}; + haskell = pkgs.haskell // { + packages = pkgs.haskell.packages // { + ghc865 = pkgs.haskell.packages.ghc865.override (old: { + overrides = with pkgs.pkgs.haskell.lib; self: super: + pkgs.overridePinnedDeps (cabalBuilder self) // { wai-middleware-metrics = dontCheck super.wai-middleware-metrics; }; }); - ghcjs = nixpkgs.haskell.packages.ghcjs.override (old: { - overrides = with nixpkgs.haskell.lib; self: super: { + ghcjs = pkgs.haskell.packages.ghcjs.override (old: { + overrides = with pkgs.haskell.lib; self: super: + pkgs.overridePinnedDeps (cabalBuilder self) // { QuickCheck = dontCheck super.QuickCheck; base-compat-batteries = dontCheck super.http-types; - clay = dontCheck (self.callCabal2nix "clay" claySrc {}); + clay = dontCheck super.clay; comonad = dontCheck super.comonad; - jsaddle-warp = dontCheck (self.callCabal2nix "jsaddle-warp" "${nixpkgs.sources.jsaddle}/jsaddle-warp" {}); + jsaddle-warp = dontCheck (self.callCabal2nix "jsaddle-warp" "${pkgs.sources.jsaddle}/jsaddle-warp" {}); http-types = dontCheck super.http-types; - miso = self.callCabal2nix "miso" nixpkgs.sources.miso {}; network-uri= dontCheck super.network-uri; scientific = dontCheck super.scientific; # takes forever servant = dontCheck super.servant; |