polysemy/nix/overlay.nix

40 lines
1.4 KiB
Nix
Raw Normal View History

{
system,
nixpkgs,
compiler,
}:
2021-01-25 01:37:04 +03:00
let
overrides = pkgs: self: super:
2021-01-25 01:37:04 +03:00
let
2021-11-21 02:50:56 +03:00
inherit (builtins) splitVersion;
inherit (pkgs.lib) compare compareLists;
hs = pkgs.haskell.lib;
jailbreak = hs.doJailbreak;
2021-01-25 01:37:04 +03:00
filter = pkgs.nix-gitignore.gitignoreSourcePure [./source-filter];
2021-11-21 02:50:56 +03:00
c2n = name: src: pkgs.haskell.lib.disableLibraryProfiling (self.callCabal2nix name (filter src) {});
2021-01-25 01:37:04 +03:00
hackage = pkg: ver: sha256: self.callHackageDirect { inherit pkg ver sha256; } {};
2021-11-21 02:50:56 +03:00
is92 = compareLists compare (splitVersion self.ghc.version) ["9" "2" "0"] >= 0;
if92 = n: f: if is92 then f n else n;
fcf = hackage "first-class-families" "0.8.0.1" "0h1rxbc7zsxrlhx5xcl58wjx3qi2wny8wb3sk7c1qnydf4ckcckz";
2021-01-25 01:37:04 +03:00
in {
2021-11-21 02:50:56 +03:00
cabal-doctest =
if is92
then hackage "cabal-doctest" "1.0.9" "0irxfxy1qw7sif4408xdhqycddb4hs3hcf6xfxm65glsnmnmwl2i"
else super.cabal-doctest;
2021-01-25 01:37:04 +03:00
dump-core = hackage "dump-core" "0.1.3.2" "1mi8p736yn00z549pwnjv4ydwbs8mwg6dla3ly447c027nq8py6g";
2021-11-21 02:50:56 +03:00
first-class-families = if92 fcf jailbreak;
2021-01-25 01:37:04 +03:00
monadLib = hackage "monadLib" "3.10" "1v4ynjcb963s3lfw3v71qdzvld1mmz1faf8swhvicma5jbvwchy2";
2021-11-21 02:50:56 +03:00
polysemy = c2n "polysemy" ../.;
polysemy-plugin = c2n "polysemy-plugin" ../polysemy-plugin;
primitive = if92 super.primitive jailbreak;
type-errors = if92 super.type-errors hs.dontCheck;
2021-01-25 01:37:04 +03:00
};
pkgs = import nixpkgs { inherit system; };
2021-01-25 01:37:04 +03:00
in
pkgs.haskell.packages.${compiler}.override { overrides = overrides pkgs; }