From cc906bfa99f62a7f97b634fbee7b94504722c440 Mon Sep 17 00:00:00 2001 From: w4tsn Date: Sat, 2 Mar 2024 19:38:29 +0100 Subject: [PATCH] add infinitime environment --- default.nix | 5 ++++- envs/infinitime/README.md | 21 +++++++++++++++++++++ envs/infinitime/shell.nix | 24 ++++++++++++++++++++++++ flake.nix | 4 ++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 envs/infinitime/README.md create mode 100644 envs/infinitime/shell.nix diff --git a/default.nix b/default.nix index c13905a..b646a85 100644 --- a/default.nix +++ b/default.nix @@ -1,7 +1,10 @@ -{ pkgs ? import {} }: { +{ pkgs ? import {} +, pkgsUnfree ? import { config = { allowUnfree = true; }; } +}: { arduino = import ./envs/arduino/shell.nix { inherit pkgs; }; cc2538-bsl = import ./envs/cc2538-bsl/shell.nix { inherit pkgs; }; firefox = import ./envs/firefox/shell.nix { inherit pkgs; }; + infinitime = import ./envs/infinitime/shell.nix { pkgs = pkgsUnfree; }; github-pages = import ./envs/github-pages/shell.nix { inherit pkgs; }; home-assistant = import ./envs/home-assistant/shell.nix { inherit pkgs; }; nannou = import ./envs/nannou/shell.nix { inherit pkgs; }; diff --git a/envs/infinitime/README.md b/envs/infinitime/README.md new file mode 100644 index 0000000..f5dbe87 --- /dev/null +++ b/envs/infinitime/README.md @@ -0,0 +1,21 @@ +# InfiniTime + +Build environment for [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime/issues?q=is%3Aissue+is%3Aopen+gcc). + +Note: Uses `unfree` package `nrf5-sdk`! + +## Building the Project + +Build instructions: + +``` +$ nix-shell +$ mkdir build +$ cd build +$ cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=/usr -DNRF5_SDK_PATH=/usr/share/nRF5_SDK -DCMAKE_BUILD_TYPE=Release .. +$ make -j6 pinetime-app +``` + +Note that the `ARM_NONE_EABI_TOOLCHAIN_PATH` is just `/usr` as everything is linked there. + +Further build instructions: https://github.com/InfiniTimeOrg/InfiniTime/blob/main/doc/buildAndProgram.md diff --git a/envs/infinitime/shell.nix b/envs/infinitime/shell.nix new file mode 100644 index 0000000..17f1ed6 --- /dev/null +++ b/envs/infinitime/shell.nix @@ -0,0 +1,24 @@ +{ pkgs ? import { + config.allowUnfree = true; +}, extraPkgs ? [] +}: + +(pkgs.buildFHSUserEnv { + name = "infinitime-env"; + targetPkgs = pkgs: with pkgs; [ + gcc-arm-embedded-10 + nrf5-sdk + zlib + cmake + gcc10 + (python3.withPackages(python: [ + python.cbor + python.intelhex + python.click + python.cryptography + python.imgtool + ])) + nodePackages.lv_font_conv + ] ++ extraPkgs; + multiPkgs = null; +}).env diff --git a/flake.nix b/flake.nix index c79cf88..f35a3b7 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,10 @@ in { devShells = nixpkgs.lib.genAttrs systems (system: import ./. { pkgs = import nixpkgs { inherit system; }; + pkgsUnfree = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; }); }; }