-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathflake.nix
More file actions
111 lines (100 loc) · 2.69 KB
/
Copy pathflake.nix
File metadata and controls
111 lines (100 loc) · 2.69 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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
description = "RISC-V VHDL Development Environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
toolchain = pkgs.stdenvNoCC.mkDerivation {
name = "toolchain";
src = pkgs.fetchurl {
url = "https://github.com/ethycS0/eSC-V/releases/download/toolchain/toolchain.tar.gz";
sha256 = "sha256:5b82aa9e830b5bed4a2ac2b1b5b8ea2c6fb3b4a8f477e84c618efbe8f848129a";
};
sourceRoot = ".";
dontBuild = true;
dontConfigure = true;
dontStrip = true;
nativeBuildInputs = [ pkgs.autoPatchelfHook ];
buildInputs = [
pkgs.glibc
pkgs.stdenv.cc.cc.lib
pkgs.gmp
pkgs.zlib
pkgs.zstd
pkgs.libmpc
pkgs.mpfr
pkgs.flex
pkgs.ncurses
pkgs.expat
pkgs.python313
];
installPhase = ''
mkdir -p $out
if [ -d "bin" ]; then
cp -r ./* $out/
else
cd */
cp -r ./* $out/
fi
chmod +x $out/bin/* 2>/dev/null || true
'';
};
commonPackages = with pkgs; [
# Languages
python312
python312Packages.pyserial
python312Packages.websockets
nodejs_24
# Language Servers
vhdl-ls
asm-lsp
# Compilation & Simulation
ghdl
gtkwave
# Synthesis & Implementation
(pkgs.yosys.withPlugins [ pkgs.yosys-ghdl ])
nextpnr
python312Packages.apycula
openfpgaloader
# Verification & Compliance
python312Packages.riscof
python312Packages.distutils
sail-riscv
spike
dtc
# Documentation
texlive.combined.scheme-full
doxygen
# Build Tools
clang
gnumake
bear
flex
# Serial Interface
screen
xxd
];
in
{
packages.default = toolchain;
devShells.default = pkgs.mkShell {
buildInputs = commonPackages ++ [ toolchain ];
shellHook = ''
export PATH="${toolchain}/bin:$PATH"
echo "Environment loaded with: ${toolchain.name}"
export NIX_YOSYS_PLUGIN_DIRS="${pkgs.yosys-ghdl}/share/yosys/plugins"
'';
};
}
);
}