-
-
Save Kiwi/aa483a99779c67b5eb8489ed4e9223d0 to your computer and use it in GitHub Desktop.
Unique shell.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? (import (fetchTarball "channel:nixos-unstable") { }) | |
, compiler ? "ghc8101" | |
}: | |
let | |
config = { | |
packageOverrides = super: | |
let self = super.pkgs; | |
in | |
{ | |
haskell = super.haskell // { | |
packages = super.haskell.packages // { | |
${compiler} = super.haskell.packages.${compiler}.override { | |
overrides = self: super: | |
with pkgs.haskell.lib; | |
{ }; | |
}; | |
}; | |
}; | |
}; | |
}; | |
pkgs = import <nixpkgs> { inherit config; }; | |
ghc = pkgs.haskell.packages.${compiler}.ghcWithHoogle (ps: | |
with ps; [ | |
containers | |
extra | |
hashable | |
unordered-containers | |
hspec | |
criterion | |
QuickCheck | |
quickcheck-instances | |
bytestring | |
hashable | |
] | |
); | |
in | |
pkgs.stdenv.mkDerivation { | |
name = "Unique"; | |
buildInputs = with pkgs; [ | |
cabal-install | |
ghc | |
which | |
zlib | |
]; | |
shellHook = '' | |
eval $(egrep ^export ${ghc}/bin/ghc) | |
export HIE_HOOGLE_DATABASE="$(cat $(which hoogle) | sed -n -e 's|.*--database \(.*\.hoo\).*|\1|p')" | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment