Skip to content

Instantly share code, notes, and snippets.

@codedmart
Last active August 29, 2015 14:27
Show Gist options
  • Select an option

  • Save codedmart/449b5f6bc6d5b842726f to your computer and use it in GitHub Desktop.

Select an option

Save codedmart/449b5f6bc6d5b842726f to your computer and use it in GitHub Desktop.
{ compiler ? "ghc7102" }:
let
pkgs = import <nixpkgs> {};
stdenv = pkgs.stdenv;
cabalInstall = if compiler == "ghc763" then haskellPackages.cabal-install_1_18_1_0 else haskellPackages.cabal-install;
haskell = pkgs.haskell // {
packages = pkgs.haskell.packages // {
ghc763 = pkgs.haskell.packages.ghc763.override {
overrides = self: pkgs: {
mkDerivation = args: pkgs.mkDerivation (args // { doHaddock = false; });
};
};
};
};
haskellPackages = haskell.packages.${compiler}.override {
overrides = self: super: {
haskell-rethinkdb = self.callPackage ~/Work/opensrc/haskell-rethinkdb {};
};
};
inputs = [
haskellPackages.ghc-mod
cabalInstall
];
in rec {
haskellRethinkDBEnv = stdenv.lib.overrideDerivation haskellPackages.haskell-rethinkdb.env (old: {
name = "haskell-rethinkdb-env";
buildInputs = old.buildInputs ++ inputs;
NIX_MYENV_NAME = "haskell-rethinkdb";
shellHook = ''
source ~/.bash_prompt
# Run the old shell hook of the haskell environment
${old.shellHook}
'';
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment