docs: build using Nix

This commit is contained in:
FliegendeWurst 2021-07-24 21:46:52 +02:00
parent 3d7ef81ab1
commit c57b8c83e2
3 changed files with 12 additions and 11 deletions

View File

@ -1,12 +1,12 @@
# raspi demo for oled(ssd1306) # raspi demo for oled ssd1306 display
in rust
## Quick start ## Quick start
> docker pull ragnaroek/rust-raspberry:1.39.0 > nix-shell
> >
> ./build.sh > rustup target add arm-unknown-linux-musleabihf
>
> cargo build --release --target arm-unknown-linux-musleabihf
Then scp the release file to your raspi. Then scp the release file to your raspi.

View File

@ -1,6 +0,0 @@
#! /bin/sh
docker run \
--volume $PWD:/home/cross/project \
--volume $HOME/.cargo/registry:/home/cross/.cargo/registry \
ragnaroek/rust-raspberry:1.39.0 \
build --release

7
shell.nix Normal file
View File

@ -0,0 +1,7 @@
with (import <nixpkgs> {});
mkShell {
nativeBuildInputs = [
pkgsCross.muslpi.stdenv.cc
];
CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER = "${pkgsCross.muslpi.stdenv.cc}/bin/armv6l-unknown-linux-musleabihf-ld";
}