utils.nix 828 Bytes
Newer Older
Valentin Reis's avatar
Valentin Reis committed
1
2
3
4
5
6
7
rec {
  filter = path:
    builtins.filterSource (path: _:
    (baseNameOf path != ".hdevtools.sock") &&
    (baseNameOf path != ".ghc.environment.x86_64-linux-8.4.4") &&
    (baseNameOf path != "_output") &&
    (baseNameOf path != "result") &&
Valentin Reis's avatar
Valentin Reis committed
8
9
    (baseNameOf path != "README") &&
    (baseNameOf path != ".README") &&
Valentin Reis's avatar
Valentin Reis committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
    (baseNameOf path != "dist")) path;

  devInputs = p: with p; [
    git
    htop
  ];

  devHPackages = p: with p; [
    cabal-install
    apply-refact
    hdevtools
    hindent
    hlint
    shake
    brittany
    ghcid
  ];

  getHackEnv = pkgs: super: package : super.shellFor {
      packages = p: [package];
      withHoogle = true;
      buildInputs = devInputs pkgs ++ devHPackages super;
    };

  cabalDevLoader = self: path: set:
    (self.callCabal2nix (baseNameOf path) (filter path) set);
}