From 2108ab0782a643aff812d9f0f95a0ffaeaeb57c1 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Tue, 18 Jan 2022 10:55:52 +0800 Subject: [PATCH] readme: update build instructions for flakes --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3d8acc5..91a0cf4 100644 --- a/README.md +++ b/README.md @@ -8,20 +8,22 @@ ### Reproducible build with Nix -See the `mcu` folder of the [nix-scripts repository](https://git.m-labs.hk/M-Labs/nix-scripts). +Thermostat firmware is packaged using the [Nix](https://nixos.org) Flakes system. Install Nix 2.4+ and enable flakes by adding ``experimental-features = nix-command flakes`` to ``nix.conf`` (e.g. ``~/.config/nix/nix.conf``). + +Once you have Flakes enabled, you can use ``nix build`` to build the firmware. ### Development environment -Clone this repository and [nix-scripts](https://git.m-labs.hk/M-Labs/nix-scripts). +Clone this repository and with Nix Flakes enabled, use the following commands: ```shell -nix-shell -I nix-scripts=[path to nix-scripts checkout] +nix develop cargo build --release ``` -The resulting ELF file will be located under `target/thumbv7em-none-eabihf/release/thermostat` +The resulting ELF file will be located under `target/thumbv7em-none-eabihf/release/thermostat`. -Alternatively, you can install the Rust toolchain without Nix using rustup; see the channel manifest file in nix-scripts (`channel-rust-nightly.toml`) to determine which Rust version to use. +Alternatively, you can install the Rust toolchain without Nix using rustup; see the Rust manifest file pulled in `flake.nix` to determine which Rust version to use. ## Debugging