-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
113 lines (99 loc) · 2.91 KB
/
shell.nix
File metadata and controls
113 lines (99 loc) · 2.91 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# WARNING!
# This file is provided as a courtesy and comes with no guarantees that it will
# continue to work in the future.
{sources ? import ./nix/sources.nix {}}: let
pkgs = sources.pkgs;
overlays = pkgs.callPackage ./nix/overlays.nix {};
kernelPackageSet =
[
# Packages required to build & develop kernels
pkgs.rustup
pkgs.wabt
# Cross-compilation for RISC-V
sources.pkgs.pkgsCross.riscv64.pkgsStatic.stdenv.cc
# Formatter/LSP for Cargo manifests (and TOML in general)
pkgs.taplo
]
# On Mac, Rust's standard library needs libiconv
++ pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.libiconv;
mainPackage = (import ./default.nix {inherit sources;}).overrideAttrs (old: {
# This makes the shell load faster.
# Usually Nix will try to load the package's source, which in this case
# is the entire repository. Given the repository is fairly large, and we
# don't actually need the source to build the development dependencies,
# we just remove the dependency on the source entirely.
src = null;
});
devPackageSet = pkgs.opamPackages.overrideScope (
pkgs.lib.composeManyExtensions [
# Set the opam-repository which has the package descriptions.
(final: prev: {
repository = prev.repository.override {
src = sources.opam-repository;
};
})
# Specify the constraints we have.
(final: prev:
prev.repository.select {
opams = [
{
name = "stdcompat";
opam = ./opam/virtual/stdcompat.opam.locked;
version = "19";
}
{
name = "octez-deps";
opam = ./opam/virtual/octez-deps.opam.locked;
}
{
name = "octez-dev-deps";
opam = ./opam/virtual/octez-dev-deps.opam;
}
];
packageConstraints = [
"ocamlformat-rpc"
];
})
# Tweak common packages.
overlays.common-overlay
# Overlays for MacOS
(
if pkgs.stdenv.isDarwin
then overlays.darwin-overlay
else final: prev: {}
)
]
);
in
pkgs.mkShell {
name = "tezos-shell";
hardeningDisable = ["stackprotector" "zerocallusedregs"];
inherit (mainPackage) NIX_LDFLAGS NIX_CFLAGS_COMPILE TEZOS_WITHOUT_OPAM OPAM_SWITCH_PREFIX;
inputsFrom = [mainPackage];
buildInputs = with pkgs;
kernelPackageSet
++ [
nodejs
cacert
curl
shellcheck
shfmt
poetry
kaitai-struct-compiler
devPackageSet.ocaml-lsp-server
devPackageSet.ocamlformat-rpc
devPackageSet.ocp-indent
devPackageSet.merlin
devPackageSet.utop
devPackageSet.odoc
]
++ (
if pkgs.stdenv.isDarwin
then [
fswatch
]
else [
inotify-tools
]
);
}