summaryrefslogtreecommitdiffstats
path: root/default.nix
blob: 599a0961c0364ee8f80fb806e24a154899db873f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

let
  pkgs = import <nixpkgs> {};
  hsEnv = pkgs.haskellPackages.ghcWithPackages (hsPkgs : with hsPkgs; [
    lens
    mtl
  ]);
in

pkgs.myEnvFun {
  name = "hack";
  buildInputs = with pkgs; [
    hsEnv
  ];

  # XXX https://nixos.org/wiki/Haskell says:
  #   Since tools (such as hdevtools [snap-loader-dynamic in our case]) that
  #   rely on the ghc-api to do haskell language manipulation are sensitive
  #   to nix-wrapping of ghc, we need the extraCmds line to ensure the
  #   proper ghc-wrapping environment variables are set inside the
  #   dev-environment shell.
  extraCmds = ''
    $(grep export ${hsEnv.outPath}/bin/ghc)
  '';
}