-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
84 lines (68 loc) · 2.48 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
description = "Build and run the ibex simple_system simulation declaratively using Nix!";
inputs = {
# fetchPypi = {
# url = "git+https://github.com/DavHau/nix-pypi-fetcher";
# };
# name = "nix-pypi-fetcher";
# url = "https://github.com/DavHau/nix-pypi-fetcher/tarball/${commit}";
# # Hash obtained using `nix-prefetch-url --unpack <url>`
# sha256 = "1c06574aznhkzvricgy5xbkyfs33kpln7fb41h8ijhib60nharnp";
mach-nix = {
url = "mach-nix/3.4.0";
};
deps = {
url = "path:./dependencies";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, mach-nix, deps }:
let
system = "x86_64-linux";
python_overlay = final: prev: {
python3 = prev.python3.override {
packageOverrides = deps.overlay_python;
};
};
pkgs = import nixpkgs {
inherit system;
overlays = [ python_overlay deps.overlay_pkgs ];
};
pythonEnv = pkgs.python3.withPackages(ps: with ps; [ pip fusesoc edalize ]);
# pyenv = mach-nix.lib.x86_64-linux.mkPython {
# requirements = ''
# fusesoc=0.3.3.dev
# '';
# overridesPre = [
# (final: prev: {
# fusesoc = my_fusesoc;
# edalize = my_edalize;
# })
# ];
# };
# buildInputs = with pkgs;
# [ verilator libelf srecord riscv-gcc-toolchain ] ++
# [ pythonEnv ];
buildInputs2 = [ pkgs.riscv-isa-sim ];
in
{
### from... ibex/examples/simple_system/README.md
# fusesoc --cores-root=. run --target=sim --setup --build lowrisc:ibex:ibex_simple_system --RV32E=0 --RV32M=ibex_pkg::RV32MFast
# make -C examples/sw/simple_system/hello_test
# ./build/lowrisc_ibex_ibex_simple_system_0/sim-verilator/Vibex_simple_system [-t] --meminit=ram,./examples/sw/simple_system/hello_test/hello_test.elf
# defaultPackage.x86_64-linux = simple_system;
# Construct a shell with all of our dependencies
devShell.x86_64-linux = pkgs.mkShell {
name = "simple_system";
version = "0.1.0";
buildInputs = buildInputs2;
# inputsFrom = buildInputs;
};
# devShells.x86_64-linux.fusesoc = pkgs.mkShell {
# name = "fusesoc";
# version = "0.1.0";
# buildInputs = [ fusesoc_deps ];
# # inputsFrom = [ my_fusesoc ]; # Use special "inputsFrom" to get the buildInputs from derivations
# };
};
}