-
Notifications
You must be signed in to change notification settings - Fork 86
/
shell.nix
72 lines (63 loc) · 2.23 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
# 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; }
, checkTVarInvariants ? false }:
with pkgs;
let
hsPkgs = if checkTVarInvariants then
ouroborosNetworkHaskellPackagesWithTVarCheck
else
ouroborosNetworkHaskellPackages;
# This provides a development environment that can be used with nix-shell or
# lorri. See https://input-output-hk.github.io/haskell.nix/tutorials/development.html
shell = hsPkgs.shellFor {
name = "cabal-dev-shell";
# These programs will be available inside the nix-shell.
nativeBuildInputs = [ cabal entr fd niv pkgconfig nixfmt stylish-haskell ];
tools = builtins.mapAttrs (name: ver: {
version = ver;
index-state = localConfig.tools-index-state;
}) { # IDE tools
ghcid = "0.8.7";
hasktags = "0.71.2";
haskell-language-server = "1.8.0.0";
# Draw graph of module dependencies
graphmod = "1.4.4";
# Profiling tools
profiteur = "0.4.6.0";
eventlog2html = "0.9.2";
hp2pretty = "0.10";
} // {
haskell-language-server = rec {
src = haskell-nix.sources."hls-1.10";
cabalProject = __readFile (src + "/cabal.project");
cabalProjectLocal = ''
constraints: stm-hamt < 1.2.0.10
'';
sha256map."https://github.com/pepeiborra/ekg-json"."7a0af7a8fd38045fd15fb13445bdcc7085325460" =
"sha256-fVwKxGgM0S4Kv/4egVAAiAjV7QB5PBqMVMCfsv7otIQ=";
};
};
shellHook = ''
export LANG="en_US.UTF-8"
'' + lib.optionalString
(pkgs.glibcLocales != null && stdenv.hostPlatform.libc == "glibc") ''
export LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive"
'';
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; }