From 2a5d171484392d55f3abfd9e48807edc77c182b0 Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Tue, 25 Jul 2023 15:51:34 +0200 Subject: Add arduino-cli docker file. --- .bin/arduino-cli | 14 ++++++++++++++ .bin/jd-arduino-cli.Dockerfile | 16 ++++++++++++++++ guix/jd/desktops/base.scm | 1 + 3 files changed, 31 insertions(+) create mode 100755 .bin/arduino-cli create mode 100644 .bin/jd-arduino-cli.Dockerfile diff --git a/.bin/arduino-cli b/.bin/arduino-cli new file mode 100755 index 0000000..7c0d41a --- /dev/null +++ b/.bin/arduino-cli @@ -0,0 +1,14 @@ +#!/bin/sh + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +if [[ $(docker images | grep jd-arduino-cli | wc -l) -eq 0 ]] +then + docker build -f "$SCRIPT_DIR/jd-arduino-cli.Dockerfile" -t jd-arduino-cli . +fi + +docker run --rm --network none -it --privileged \ + -v $(pwd):/src \ + -v jd-arduino-cli-tmp:/tmp \ + -v /dev:/dev jd-arduino-cli \ + arduino-cli $@ diff --git a/.bin/jd-arduino-cli.Dockerfile b/.bin/jd-arduino-cli.Dockerfile new file mode 100644 index 0000000..cb8eb91 --- /dev/null +++ b/.bin/jd-arduino-cli.Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.12-rc-slim + +RUN apt update && apt install -y wget && \ + wget https://downloads.arduino.cc/arduino-cli/nightly/arduino-cli_nightly-latest_Linux_64bit.tar.gz && \ + tar -C /usr/bin/ -xf arduino-cli_nightly-latest_Linux_64bit.tar.gz + +RUN mkdir ~/.arduino15 && \ + echo "board_manager:" > ~/.arduino15/arduino-cli.yaml && \ + echo " additional_urls:" >> ~/.arduino15/arduino-cli.yaml && \ + echo " - http://arduino.esp8266.com/stable/package_esp8266com_index.json" >> ~/.arduino15/arduino-cli.yaml + + +RUN arduino-cli core update-index && \ + arduino-cli core install esp8266:esp8266 + +WORKDIR /src \ No newline at end of file diff --git a/guix/jd/desktops/base.scm b/guix/jd/desktops/base.scm index d93d878..656c622 100644 --- a/guix/jd/desktops/base.scm +++ b/guix/jd/desktops/base.scm @@ -79,6 +79,7 @@ "docker" "audio" ;; control audio devices "video" ;; access to webcam + "dialout" ;; access to /dev/ttyUSBX devices ))) %base-user-accounts)) -- cgit v1.2.3