45 lines
1.1 KiB
Nix
45 lines
1.1 KiB
Nix
{
|
|
compiler ? "ghc865",
|
|
withHIE ? false
|
|
}:
|
|
|
|
let
|
|
# 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";
|
|
rev = "de3780b937d2984f9b5e20d191f23be4f857b3aa";
|
|
}) {
|
|
# Pass no config for purity
|
|
config = {};
|
|
overlays = [
|
|
(import all-hies {}).overlay
|
|
];
|
|
};
|
|
hp = pkgs.haskell.packages."${compiler}";
|
|
src = pkgs.nix-gitignore.gitignoreSource [] ./.;
|
|
drv = hp.callCabal2nix "Hash2Pub" "${src}/Hash2Pub.cabal" {};
|
|
in
|
|
{
|
|
my_project = drv;
|
|
shell = hp.shellFor {
|
|
withHoogle = true;
|
|
packages = p: [ drv ];
|
|
buildInputs = with hp;
|
|
[
|
|
haddock
|
|
cabal-install
|
|
hlint
|
|
stylish-haskell
|
|
pkgs.python3Packages.asn1ate
|
|
]
|
|
++ (if withHIE then [ hie ] else []);
|
|
};
|
|
}
|