Platformio: Difference between revisions
m remaining mardown formatting code |
m Update the udev rules as per latest error messages from platformio. Use the `with pkgs;` nix style |
||
(One intermediate revision by one other user not shown) | |||
Line 3: | Line 3: | ||
== Basic development environment == | == Basic development environment == | ||
< | <syntaxhighlight lang="nix"> | ||
{ pkgs ? import <nixpkgs> {} }: | { pkgs ? import <nixpkgs> {} }: | ||
let | let | ||
in | in | ||
pkgs.mkShell { | pkgs.mkShell { | ||
buildInputs = [ | buildInputs = with pkgs; [ | ||
platformio | |||
# optional: needed as a programmer i.e. for esp32 | # optional: needed as a programmer i.e. for esp32 | ||
avrdude | |||
]; | ]; | ||
} | } | ||
</ | </syntaxhighlight> | ||
== NixOS == | == NixOS == | ||
Line 20: | Line 20: | ||
Add the required udev rules. | Add the required udev rules. | ||
< | <syntaxhighlight lang="nix"> | ||
{ | { | ||
services.udev.packages = [ | services.udev.packages = with pkgs; [ | ||
platformio-core.udev | |||
openocd | |||
]; | ]; | ||
} | } | ||
</ | </syntaxhighlight> | ||
== Use in vscode == | == Use in vscode == | ||
Line 53: | Line 53: | ||
# https://github.com/direnv/direnv/issues/992 | # https://github.com/direnv/direnv/issues/992 | ||
if [ -z "$IN_NIX_SHELL" ]; then | if [ -z "$IN_NIX_SHELL" ]; then | ||
use flake $FLAKE\#pio-arduino-fhs | use flake $FLAKE\#pio-arduino-fhs | ||
fi | fi | ||