-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
38 lines (28 loc) · 1.32 KB
/
shell.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
let
sources = import ./nix/sources.nix;
overlays = import ./nix/overlays.nix;
# Overlays let us override certain packages at a central location.
nixpkgs-overlayed = import sources.nixpkgs { inherit overlays; };
nixpkgs = import sources.nixpkgs { };
hp = nixpkgs-overlayed.haskellPackages;
inherit (nixpkgs.lib.attrsets) getAttrFromPath;
contents = import ./nix/contents.nix { inherit nixpkgs; };
# Brittany, as the formatter, is just here as an example.
# I personally prefer to have the formatters pinned to a version and then
# made available via direnv to avoid unnecessary diff pollution across upgrades.
# Niv is great at pinning dependencies in sources.json and computing SHA's etc.
nix-tooling = with hp; [ (callCabal2nix "niv" sources.niv { }) ];
# Haskell tools
haskell-tooling = with hp; [ cabal-install ghcid hlint hasktags ];
# Add more as we need them.
formatters =
let brittany = hp.callCabal2nix "brittany" sources.brittany { };
in [ brittany ];
system-tooling = with nixpkgs; [
inotify-tools # needed for HotExe.sh (filesystem notifs.)
psmisc # needed for HotExe.sh: (kill processes by port.)
];
in hp.shellFor {
packages = p: map (contents.getPkg p) (builtins.attrNames contents.pkgList);
buildInputs = nix-tooling ++ haskell-tooling ++ system-tooling ++ formatters;
}