-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdefault.nix
43 lines (36 loc) · 1.07 KB
/
default.nix
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ pkgs }:
let
inherit (builtins) filterSource baseNameOf elem;
inherit (pkgs.lib) getBin;
_iter = srcBasenames:
let
src = filterSource (path: _: elem (baseNameOf path) srcBasenames) ./.;
iter = pkgs.haskellPackages.callCabal2nix "iter" src { };
in pkgs.haskell.lib.overrideCabal iter (old: {
buildDepends = [ pkgs.makeWrapper ];
postInstall =
"wrapProgram $out/bin/iter --prefix PATH : ${getBin pkgs.icdiff}/bin";
});
in rec {
inherit pkgs;
iter =
_iter [ "iter.cabal" "LICENSE" "app" "Main.hs" "Legacy.hs" "Common.hs" ];
shell = pkgs.haskellPackages.shellFor {
# only include "iter.cabal" for faster iteration via 'cached-nix-shell'
packages = p: [ (_iter [ "iter.cabal" ]) ];
buildInputs = [
pkgs.icdiff # pkgs.haskellPackages.shellFor does not pick this up
pkgs.ghcid
pkgs.ormolu
pkgs.haskellPackages.hlint
pkgs.haskellPackages.apply-refact
pkgs.cabal-install
pkgs.nixfmt
pkgs.ormolu
pkgs.just
pkgs.pylint
pkgs.black
pkgs.mypy
];
};
}