InfiniTime/shell.nix
2024-06-09 20:28:21 -07:00

51 lines
1.3 KiB
Nix

{ pkgs ? import <nixpkgs> {} }:
with pkgs; let
py4McuBoot = python3.withPackages (ps: with ps; [
cbor
intelhex
click
cryptography
pillow
]);
lv_img_convWrapper = pkgs.writeScriptBin "lv_img_conv" ''
npm install lv_img_conv
nodejs node_modules/lv_img_conv/lv_img_conv.js
'';
buildInfinitime = pkgs.writeScriptBin "build-infinitime" ''
mkdir -p build/
cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=$ARM_NONE_EABI_TOOLCHAIN_PATH \
-DNRF5_SDK_PATH=$NRF5_SDK_PATH \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DBUILD_DFU=$BUILD_DFU \
-DBUILD_RESOURCES=$BUILD_RESOURCES \
-DTARGET_DEVICE=$TARGET_DEVICE \
-S . -B build
cmake --build build -j6
'';
in mkShell {
packages = [
gcc-arm-embedded-10
nrf5-sdk
cmake
nodePackages.lv_font_conv
lv_img_convWrapper
# lv_img_conv
nodejs
py4McuBoot
clang-tools
SDL2
libpng
adafruit-nrfutil
buildInfinitime
# watchmate # wish this worked -- use flatpak run io.gitlab.azymohliad.WatchMate
];
ARM_NONE_EABI_TOOLCHAIN_PATH="${gcc-arm-embedded-10}";
NRF5_SDK_PATH="${nrf5-sdk}/share/nRF5_SDK";
CMAKE_BUILD_TYPE="Release";
BUILD_DFU=1;
BUILD_RESOURCES=1;
TARGET_DEVICE="PINETIME";
}