forked from chipsalliance/rocket-chip
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
49 lines (46 loc) · 1.61 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
{
description = "rocket-chip";
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
verilator cmake ninja
python3 python3Packages.bootstrapped-pip
pkgsCross.riscv64-embedded.buildPackages.gcc
spike 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
'';
};
}
)
// { inherit inputs; overlays.default = overlay; };
}