forked from casper-network/casper-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
46 lines (42 loc) · 1.73 KB
/
shell.nix
File metadata and controls
46 lines (42 loc) · 1.73 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
# This is an unsupported development environment, instantly enabling `make build
# build-contracts-rs`. There is no official support for this nix derivation.
#
# Do not use this, but follow instructions in the `README.md` instead.
#
# `ops`: enables support for running `casper-tool` and various experimental cluster-based
# testing utilities.
# `dev`: enables tooling useful for development, but not strictly necessary to run/build
{ pkgs ? (import <nixpkgs>) { }, ops ? true, dev ? true }:
let
# `volatile` is not packaged in nix.
volatile = pkgs.python38Packages.buildPythonPackage rec {
pname = "volatile";
version = "2.1.0";
src = pkgs.python38Packages.fetchPypi {
inherit pname version;
sha256 = "1lri7a6pmlx9ghbrsgd702c3n862glwy0p8idh0lwdg313anmqwv";
};
doCheck = false;
};
python = pkgs.python3.withPackages
(python-packages: with python-packages; [ click kubernetes volatile ]);
in pkgs.stdenv.mkDerivation {
name = "rustenv";
nativeBuildInputs = with pkgs; [ pkg-config perl which protobuf ];
buildInputs = with pkgs;
[ cmake pkg-config openssl.dev zlib.dev rustup ]
++ lib.lists.optionals ops [ kubectl python skopeo git nix ]
++ lib.lists.optionals dev [ black ];
# Enable SSL support in pure shells
SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
NIX_SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
# `protoc` is required but not found by the `prost` crate, unless this envvar is set
PROTOC = "${pkgs.protobuf}/bin/protoc";
# Convenient setup when working with k3s clusters.
shellHook = ''
if [ -e nix/k3s.yaml ]; then
echo "Found k3s.yaml in nix folder, setting KUBECONFIG envvar.";
export KUBECONFIG=$(pwd)/k3s.yaml
fi;
'';
}