forked from cardano-foundation/cardano-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
77 lines (70 loc) · 2.58 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
######################################################################
#
# Creates a development environment for Cabal builds or ghci sessions,
# with various build tools included.
#
# Short instructions are in ./cabal-nix.project.
#
# Full instructions - https://github.com/input-output-hk/cardano-wallet/wiki/Building#cabalnix-build
#
# If you need a nix-shell with Cabal, GHC, and system dependencies, but *without*
# Haskell dependencies, see ./nix/cabal-shell.nix.
#
######################################################################
{ walletPackages ? import ./default.nix { inherit system crossSystem config sourcesOverride; }
, system ? builtins.currentSystem
, crossSystem ? null
, config ? {}
, pkgs ? walletPackages.private.pkgs
, profiling ? false # enable profiling in haskell dependencies
, sourcesOverride ? {} # see sourcesOverride in nix/default.nix
}:
let
inherit (pkgs) lib;
inherit (pkgs.haskell-nix.haskellLib) selectProjectPackages;
mkShell = name: project: project.shellFor rec {
inherit name;
packages = ps: lib.attrValues (selectProjectPackages ps);
buildInputs = (with walletPackages; [
cardano-node
cardano-cli
cardano-address
bech32
project.hsPkgs.pretty-simple.components.exes.pretty-simple
]) ++ (with pkgs.buildPackages.buildPackages; [
go-jira
haskellPackages.ghcid
niv
pkgconfig
python3Packages.openapi-spec-validator
(ruby.withPackages (ps: [ ps.thor ]))
sqlite-interactive
curlFull
jq
yq
] ++ lib.filter
(drv: lib.isDerivation drv && drv.name != "regenerate-materialized-nix")
(lib.attrValues haskell-build-tools));
# fixme: this is needed to prevent Haskell.nix double-evaluating hoogle
tools.hoogle = {
inherit (pkgs.haskell-build-tools.hoogle) version;
inherit (pkgs.haskell-build-tools.hoogle.project) index-state;
checkMaterialization = false;
materialized = ./nix/materialized/hoogle;
};
CARDANO_NODE_CONFIGS = pkgs.cardano-node-deployments;
# If any build input has bash completions, add it to the search
# path for shell completions.
XDG_DATA_DIRS = lib.concatStringsSep ":" (
[(builtins.getEnv "XDG_DATA_DIRS")] ++
(lib.filter
(share: builtins.pathExists (share + "/bash-completion"))
(map (p: p + "/share") buildInputs))
);
meta.platforms = lib.platforms.unix;
};
in
with walletPackages.private;
if profiling
then mkShell "cardano-wallet-shell-profiled" profiledProject
else mkShell "cardano-wallet-shell" project