-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
69 lines (66 loc) · 1.86 KB
/
flake.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
{
description = "rocket chip development flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
flake-utils,
} @ inputs: let
overlay = import ./overlay.nix;
in
flake-utils.lib.eachDefaultSystem
(
system: let
pkgs = import nixpkgs {
inherit system;
overlays = [overlay];
};
deps = with pkgs; [
git
gnumake
autoconf
automake
mill
dtc
boost
verilator
cmake
ninja
python3
python3Packages.pip
pkgsCross.riscv64-embedded.buildPackages.gcc
pkgsCross.riscv64-embedded.buildPackages.gdb
openocd
spike
# TODO:
# z3 compilation error in darwin
# circt
# riscvTests
];
in {
legacyPackages = pkgs;
devShell = pkgs.mkShell.override {stdenv = pkgs.clangStdenv;} {
buildInputs = deps;
SPIKE_ROOT = "${pkgs.spike}";
# RISCV_TESTS_ROOT = "${pkgs.riscvTests}";
RV64_TOOLCHAIN_ROOT = "${pkgs.pkgsCross.riscv64-embedded.buildPackages.gcc}";
shellHook = ''
# Tells pip to put packages into $PIP_PREFIX instead of the usual locations.
# See https://pip.pypa.io/en/stable/user_guide/#environment-variables.
export PIP_PREFIX=$(pwd)/venv/pip_packages
export PYTHONPATH="$PIP_PREFIX/${pkgs.python3.sitePackages}:$PYTHONPATH"
export PATH="$PIP_PREFIX/bin:$PATH"
unset SOURCE_DATE_EPOCH
pip3 install importlib-metadata typing-extensions riscof==1.25.2 pexpect
'';
};
}
)
// {
inherit inputs;
overlays.default = overlay;
};
}