-
Notifications
You must be signed in to change notification settings - Fork 2
/
shell.nix
88 lines (79 loc) · 2.75 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# This file is used by nix-shell.
# It just takes the shell attribute from default.nix.
{ config ? { }
, sourcesOverride ? { }
, withHoogle ? false
, pkgs ? import ./nix {
inherit config sourcesOverride;
}
}:
with pkgs;
let
# Both stylish-haskell and Haskell-language-server are pulled in with niv
# directly from their repositories at specific commits because the versions we
# want are not yet in Hackage. Right now we are using stylish-haskell at
# version 0.12.2.0 with some features that are not yet released in hackage,
# and hls at version 1.1.0 which is also not released in hackage. Once one of
# those arrives we can pull it in specifying a version on the tools attribute
# set, something like:
#
# > tools = {
# > ...
# > haskell-language-server = "1.3.0.0";
# > stylish-haskell = "0.12.3.0";
#
# Note that the tools attribute comes from haskell-nix when defining the
# shellFor function. At the same time, the niv depencency will not be needed
# and it can be removed with `niv drop hls-released` or `niv drop
# stylish-haskell` (or manually removing the relevant entries from
# `sources.json`).
stylish-haskell = import ./nix/stylish-haskell.nix { inherit pkgs; };
hls = import ./nix/hls.nix { inherit pkgs; };
# This provides a development environment that can be used with nix-shell or
# lorri. See https://The-Blockchain-Company.github.io/haskell.nix/user-guide/development/
# NOTE: due to some cabal limitation,
# you have to remove all `source-repository-package` entries from cabal.project
# after entering nix-shell for cabal to use nix provided dependencies for them.
shell = arkNetworkHaskellPackages.shellFor {
name = "cabal-dev-shell";
packages = ps: lib.attrValues (haskell-nix.haskellLib.selectProjectPackages ps);
# These programs will be available inside the nix-shell.
buildInputs = [
cabalWrapped
entr
niv
pkgconfig
nixpkgs-fmt
stylish-haskell
hls.hls
hls.hls-wrapper
hls.implicit-hie
];
tools = {
ghcid = "0.8.7";
hasktags = "0.71.2";
# https://hackage.haskell.org/package/graphmod
graphmod = "1.4.4";
# haskell-language-server = "1.3.0.0";
# todo: add back the build tools which are actually necessary
# hlint = "...";
};
inherit withHoogle;
};
devops = pkgs.stdenv.mkDerivation {
name = "devops-shell";
buildInputs = [
niv
];
shellHook = ''
echo "DevOps Tools" \
| ${figlet}/bin/figlet -f banner -c \
| ${lolcat}/bin/lolcat
echo "NOTE: you may need to export GITHUB_TOKEN if you hit rate limits with niv"
echo "Commands:
* niv update <package> - update package
"
'';
};
in
shell // { inherit devops; }