-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
59 lines (50 loc) · 1.44 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs { };
in
let
# Wrap Stack to configure Nix integration and target the correct Stack-Nix file
#
# - nix: Enable Nix support
# - no-nix-pure: Pass environment variables, like `NIX_PATH`
# - nix-shell-file: Nix file to use (otherwise it uses `shell.nix` by default)
stack-wrapped = pkgs.symlinkJoin {
name = "stack";
paths = [ pkgs.stack ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/stack \
--add-flags "\
--nix \
--no-nix-pure \
--nix-shell-file=nix/stack-integration.nix \
"
'';
};
in
pkgs.mkShell {
buildInputs = [
# dev
# TODO clean this up
# pkgs.haskell-language-server
# pkgs.vscode
# build
stack-wrapped
pkgs.zlib
# test
pkgs.tree
# analyze/lint
pkgs.hlint
pkgs.haskellPackages.apply-refact
pkgs.stylish-haskell
pkgs.haskellPackages.weeder
pkgs.haskellPackages.stan
];
# Configure the Nix path to our own `pkgs`, to ensure Stack-with-Nix uses the
# correct one rather than the global <nixpkgs> when looking for the right
# `ghc` argument to pass in `nix/stack-integration.nix`
# See https://nixos.org/nixos/nix-pills/nix-search-paths.html for more information
NIX_PATH = "nixpkgs=" + pkgs.path;
# This seems to be necessary when running tests that capture stdout/stderr
TASTY_NUM_THREADS = 1;
}