-
Notifications
You must be signed in to change notification settings - Fork 86
/
shell.nix
99 lines (85 loc) · 2.67 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
89
90
91
92
93
94
95
96
97
98
99
# A shell setup providing build tools and utilities for a development
# environment. This is now based on haskell.nix and it's haskell-nix.project
# (see 'default.nix').
{ compiler ? "ghc8107"
# nixpkgs 21.05 at 2021-11-16
, pkgs ? import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/01eaa66bb663412c31b5399334f118030a91f1aa.tar.gz") { }
, hsPkgs ? import ./default.nix { }
, libsodium-vrf ? pkgs.libsodium.overrideAttrs (oldAttrs: {
name = "libsodium-1.0.18-vrf";
src = pkgs.fetchFromGitHub {
owner = "input-output-hk";
repo = "libsodium";
# branch tdammers/rebased-vrf
rev = "66f017f16633f2060db25e17c170c2afa0f2a8a1";
sha256 = "12g2wz3gyi69d87nipzqnq4xc6nky3xbmi2i2pb2hflddq8ck72f";
};
nativeBuildInputs = [ pkgs.autoreconfHook ];
configureFlags = "--enable-static";
})
}:
let
libs = [
libsodium-vrf
pkgs.systemd
pkgs.zlib
pkgs.lzma
];
tools = [
pkgs.pkgconfig
pkgs.haskellPackages.ghcid
pkgs.haskellPackages.hspec-discover
pkgs.haskellPackages.graphmod
pkgs.haskellPackages.cabal-plan
pkgs.haskellPackages.cabal-fmt
# Handy to interact with the hydra-node via websockets
pkgs.ws
# For validating JSON instances against a pre-defined schema
pkgs.python3Packages.jsonschema
pkgs.yq
# For plotting results of hydra-cluster benchmarks
pkgs.gnuplot
];
haskellNixShell = hsPkgs.shellFor {
packages = ps: with ps; [
hydra-prelude
hydra-node
hydra-plutus
hydra-cluster
merkle-patricia-tree
];
# Haskell.nix managed tools (via hackage)
tools = {
cabal = "3.4.0.0";
fourmolu = "latest";
haskell-language-server = "latest";
};
buildInputs = libs ++ tools;
withHoogle = true;
# Always create missing golden files
CREATE_MISSING_GOLDEN = 1;
};
# A "cabal-only" shell which does not use haskell.nix
cabalShell = pkgs.mkShell {
name = "hydra-node-cabal-shell";
buildInputs = libs ++ [
pkgs.haskell.compiler.${compiler}
pkgs.cabal-install
pkgs.git
pkgs.pkgconfig
] ++ tools;
# Ensure that libz.so and other libraries are available to TH splices.
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath libs;
# Force a UTF-8 locale because many Haskell programs and tests
# assume this.
LANG = "en_US.UTF-8";
# Make the shell suitable for the stack nix integration
# <nixpkgs/pkgs/development/haskell-modules/generic-stack-builder.nix>
GIT_SSL_CAINFO = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
STACK_IN_NIX_SHELL = "true";
};
in
haskellNixShell // {
cabalOnly = cabalShell;
ci = haskellNixShell { withHoogle = false; }
}