2020-07-26 16:26:26 +02:00
|
|
|
{
|
2020-07-26 16:38:56 +02:00
|
|
|
compiler ? "ghc865",
|
|
|
|
withHIE ? false
|
2020-03-18 23:53:43 +01:00
|
|
|
}:
|
2020-03-04 15:29:35 +01:00
|
|
|
|
|
|
|
let
|
2020-07-26 16:26:26 +02:00
|
|
|
# pin all-hies for getting the language server
|
|
|
|
all-hies = fetchTarball {
|
|
|
|
url = "https://github.com/infinisil/all-hies/tarball/b8fb659620b99b4a393922abaa03a1695e2ca64d";
|
|
|
|
sha256 = "sha256:0br6wsqpfk1lzz90f7zw439w1ir2p54268qilw9l2pk6yz7ganfx";
|
|
|
|
};
|
|
|
|
pkgs = import (
|
|
|
|
builtins.fetchGit {
|
|
|
|
name = "nixpkgs-pinned";
|
|
|
|
url = https://github.com/NixOS/nixpkgs/;
|
|
|
|
ref = "refs/heads/release-20.03";
|
2020-09-18 20:25:15 +02:00
|
|
|
rev = "faf5bdea5d9f0f9de26deaa7e864cdcd3b15b4e8";
|
2020-07-26 16:26:26 +02:00
|
|
|
}) {
|
|
|
|
# Pass no config for purity
|
|
|
|
config = {};
|
2020-09-21 22:14:33 +02:00
|
|
|
overlays = if withHIE then [
|
2020-07-26 16:26:26 +02:00
|
|
|
(import all-hies {}).overlay
|
2020-09-21 22:14:33 +02:00
|
|
|
] else [];
|
2020-07-26 16:26:26 +02:00
|
|
|
};
|
2020-03-18 23:53:43 +01:00
|
|
|
hp = pkgs.haskell.packages."${compiler}";
|
2020-04-02 10:49:15 +02:00
|
|
|
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
|
|
|
|
drv = hp.callCabal2nix "Hash2Pub" "${src}/Hash2Pub.cabal" {};
|
2020-03-04 15:29:35 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
my_project = drv;
|
2020-03-18 23:53:43 +01:00
|
|
|
shell = hp.shellFor {
|
2020-03-04 15:29:35 +01:00
|
|
|
withHoogle = true;
|
|
|
|
packages = p: [ drv ];
|
2020-03-18 23:53:43 +01:00
|
|
|
buildInputs = with hp;
|
2020-03-04 15:29:35 +01:00
|
|
|
[
|
|
|
|
haddock
|
|
|
|
cabal-install
|
|
|
|
hlint
|
2020-05-19 16:33:00 +02:00
|
|
|
stylish-haskell
|
2020-04-27 02:07:24 +02:00
|
|
|
pkgs.python3Packages.asn1ate
|
2020-07-26 16:38:56 +02:00
|
|
|
]
|
|
|
|
++ (if withHIE then [ hie ] else []);
|
2020-03-04 15:29:35 +01:00
|
|
|
};
|
|
|
|
}
|