mirror of
https://github.com/icewind1991/cynthion-flake.git
synced 2026-06-03 14:24:07 +02:00
42 lines
751 B
Nix
42 lines
751 B
Nix
{
|
|
stdenvNoCC,
|
|
cynthion-unwrapped,
|
|
zsh,
|
|
yosys,
|
|
nextpnr,
|
|
trellis,
|
|
bitstream ? null,
|
|
platform ? null,
|
|
...
|
|
}:
|
|
stdenvNoCC.mkDerivation {
|
|
pname = "cynthion-gateware-${bitstream}";
|
|
version = "${cynthion-unwrapped.version}-${platform}";
|
|
|
|
inherit (cynthion-unwrapped) src;
|
|
dontFixup = true;
|
|
|
|
nativeBuildInputs = [
|
|
cynthion-unwrapped
|
|
yosys
|
|
nextpnr
|
|
trellis
|
|
zsh
|
|
];
|
|
|
|
LUNA_PLATFORM = "cynthion.gateware.platform:${platform}";
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
|
|
mkdir -p assets/${platform}
|
|
python -m cynthion.gateware.${bitstream}.top --dry-run --output assets/${platform}/${bitstream}.bit
|
|
|
|
runHook postBuild
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/share
|
|
cp -r assets $out/share
|
|
'';
|
|
}
|