mirror of
https://github.com/icewind1991/cynthion-flake.git
synced 2026-06-03 22:34:06 +02:00
add moondancer firmware
This commit is contained in:
parent
37b2e28862
commit
4beacc0c7c
6 changed files with 575 additions and 5 deletions
42
pkgs/cynthion/moondancer.nix
Normal file
42
pkgs/cynthion/moondancer.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
makeRustPlatform,
|
||||
rustc,
|
||||
cynthion-unwrapped,
|
||||
zsh,
|
||||
yosys,
|
||||
nextpnr,
|
||||
trellis,
|
||||
rust-bin,
|
||||
pkgsCross,
|
||||
...
|
||||
}: let
|
||||
# this doesn't work yet...
|
||||
toolchain = rust-bin.stable.${rustc.version}.default.override {
|
||||
extensions = ["rust-src"];
|
||||
targets = ["riscv32imac-unknown-none-elf"];
|
||||
};
|
||||
rustPlatform = pkgsCross.riscv32-embedded.pkgsBuildHost.makeRustPlatform {
|
||||
cargo = toolchain;
|
||||
rustc = toolchain;
|
||||
};
|
||||
in
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "cynthion-moondancer";
|
||||
inherit (cynthion-unwrapped) version src;
|
||||
|
||||
postPatch = ''
|
||||
cp ${./moondancer-cargo.lock} Cargo.lock
|
||||
|
||||
substituteInPlace Cargo.toml \
|
||||
--replace-fail '[profile.release]' "[profile.release]
|
||||
panic=\"abort\""
|
||||
'';
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./moondancer-cargo.lock;
|
||||
};
|
||||
|
||||
sourceRoot = "source/firmware";
|
||||
|
||||
cargoBuildFlags = ["-p moondancer" "--target riscv32imac-unknown-none-elf"];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue