From 98acedca0e07a43626c40a04da3be1e5f6ab1bf6 Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Sat, 24 Jul 2021 21:46:52 +0200 Subject: [PATCH] docs: build using Nix --- README.md | 17 +++++++++++++++++ shell.nix | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 README.md create mode 100644 shell.nix diff --git a/README.md b/README.md new file mode 100644 index 0000000..85f1097 --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# raspi demo for oled ssd1306 display + +## Quick start + +> nix-shell +> +> rustup target add arm-unknown-linux-musleabihf +> +> cargo build --release --target arm-unknown-linux-musleabihf + +Then scp the release file to your raspi. + +## Example + +![picture](./images/01.jpg) + +![primitive](./images/02.jpg) diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..eb954d4 --- /dev/null +++ b/shell.nix @@ -0,0 +1,7 @@ +with (import {}); +mkShell { + nativeBuildInputs = [ + pkgsCross.muslpi.stdenv.cc + ]; + CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER = "${pkgsCross.muslpi.stdenv.cc}/bin/armv6l-unknown-linux-musleabihf-ld"; +}