-
Notifications
You must be signed in to change notification settings - Fork 1
/
shell.nix
69 lines (61 loc) · 1.61 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
with import <nixpkgs> { };
let
rust_overlay = import (builtins.fetchTarball
"https://github.com/oxalica/rust-overlay/archive/master.tar.gz");
nixpkgs = import <nixpkgs> { overlays = [ rust_overlay ]; };
rustChannel = nixpkgs.rust-bin.nightly."2021-08-26".default.override {
extensions =
[ "rust-src" "rust-analysis" ];
};
pythonPackages = python39Packages;
in pkgs.mkShell rec {
name = "spectrum-env";
venvDir = "./.venv";
buildInputs = [
# Basic build requirements
gmp6
stdenv
rustChannel
rust-analyzer
protobuf
glibc
gnum4
openssl
libffi
pkgconfig
# local testing
etcd
gnuplot
# DevOps -- for running experiments
packer
terraform_0_15
# Python -- for experiment scripts
pythonPackages.python
# We need a venv because some Python dependencies aren't in nixpkgs.
# This execute some shell code to initialize a venv in $venvDir before
# dropping into the shell
pythonPackages.venvShellHook
# Linting + development
pythonPackages.black
# pythonPackages.pylint
pythonPackages.ipython
nodePackages.pyright
# experiment scripts
awscli2
curl
tokei
];
PROTOC = "${pkgs.protobuf}/bin/protoc";
RUST_SRC_PATH = "${rustChannel}/lib/rustlib/src/rust/library";
# Run this command, only after creating the virtual environment
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
pip install -r experiments/requirements.txt
pip install pylint
'';
postShellHook = ''
export PATH="$PATH:/home/zjn/.cargo/bin"
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
'';
}