her.esy.fun/src/posts/0010-Haskell-Now/project/default.nix
Yann Esposito (Yogsototh) 0d1e4ff2a3
added project with nix
2019-12-30 21:47:22 +01:00

33 lines
779 B
Nix

{ nixpkgs ? import ./nixpkgs.nix
, compiler ? "default"
, doBenchmark ? false }:
let
inherit (nixpkgs) pkgs;
name = "project";
haskellPackages = pkgs.haskellPackages;
variant = if doBenchmark
then pkgs.haskell.lib.doBenchmark
else pkgs.lib.id;
drv = haskellPackages.callCabal2nix name ./. {};
in
{
my_project = drv;
shell = haskellPackages.shellFor {
# generate hoogle doc
withHoogle = true;
packages = p: [drv];
# packages dependencies (by default haskellPackages)
buildInputs = with haskellPackages;
[ hlint
ghcid
cabal-install
cabal2nix
hindent
];
# nice prompt for the nix-shell
shellHook = ''
export PS1="\n[${name}:\033[1;32m\]\W\[\033[0m\]]> "
'';
};
}