From c57b8c83e27c9bd6f51b4dcd2eac07b3f4f4e975 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 | 10 +++++----- build.sh | 6 ------ shell.nix | 7 +++++++ 3 files changed, 12 insertions(+), 11 deletions(-) delete mode 100755 build.sh create mode 100644 shell.nix diff --git a/README.md b/README.md index 3b53363..85f1097 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# raspi demo for oled(ssd1306) - -in rust +# raspi demo for oled ssd1306 display ## 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. diff --git a/build.sh b/build.sh deleted file mode 100755 index 8b8ff6e..0000000 --- a/build.sh +++ /dev/null @@ -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 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"; +}