-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathshell.nix
41 lines (37 loc) · 1.11 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
39
40
41
{ pkgs ? import ./nix/nixpkgs.nix { } }:
let
nix-pre-commit-hooks = import (builtins.fetchTarball
"https://github.com/cachix/git-hooks.nix/tarball/master");
in let
pre-commit = {
# Configured with the module options defined in `modules/pre-commit.nix`:
pre-commit-check = nix-pre-commit-hooks.run {
src = ./.;
# If your hooks are intrusive, avoid running on each commit with a default_states like this:
# default_stages = ["manual" "pre-push"];
hooks = { fourmolu.enable = true; };
};
};
in pkgs.mkShell rec {
buildInputs = [
# Haskell dev tools
pkgs.ghc
pkgs.cabal-install
pkgs.haskell-language-server
pkgs.fourmolu
pkgs.hlint
pkgs.haskellPackages.zlib
# Nix dev tools
pkgs.nil
pkgs.nixfmt-classic
pkgs.nixpkgs-fmt
# Required native libs
pkgs.pkg-config
pkgs.zlib
] ++ pre-commit.pre-commit-check.enabledPackages;
shellHook = ''
${pre-commit.pre-commit-check.shellHook}
'';
# Required for cabal to find the location of zlib and other native libraries
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
}