-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathshell.nix
47 lines (39 loc) · 1.26 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
# This file is used by nix-shell.
# It just takes the shell attribute from default.nix.
{ metadataPackages ? import ./default.nix { inherit system crossSystem config sourcesOverride; }
, system ? builtins.currentSystem
, crossSystem ? null
, config ? {}
, pkgs ? metadataPackages.pkgs
, profiling ? false # enable profiling in haskell dependencies
, sourcesOverride ? {} # see sourcesOverride in nix/default.nix
, withHoogle ? true
}:
let
inherit (pkgs) lib;
inherit (pkgs.haskell-nix.haskellLib) selectProjectPackages;
mkShell = name: project: project.shellFor rec {
inherit name;
packages = ps: lib.attrValues (selectProjectPackages ps);
nativeBuildInputs = (with pkgs; [
cabalWrapped
haskellPackages.ghcid
git
hlint
niv
nix
pkgconfig
stylish-haskell
]);
tools = { cabal = "3.4.0.0"; };
# Prevents cabal from choosing alternate plans, so that
# *all* dependencies are provided by Nix.
exactDeps = true;
inherit withHoogle;
GIT_SSL_CAINFO = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
meta.platforms = lib.platforms.unix;
};
in
if profiling
then mkShell "metadata-shell-profiled" metadataPackages.profiledProject
else mkShell "metadata-shell" metadataPackages.project