How to use platformio with vscode

Here is how to run platformio and build an esp32 firmware

  1. create a nix shell

shell.nix

{ pkgs ? import <nixpkgs> {} }:
let
in
  pkgs.mkShell {
    buildInputs = [
      pkgs.platformio
      pkgs.avrdude
    ];
}
  1. open the shell
nix-shell
  1. Open vscode inside the shell
code .
  1. tell vscode to not use the built-in platformio in settings.json
    "platformio-ide.useBuiltinPIOCore": false,

and thats it !
at least thats what worked for me after scratching my head for 3hours on this …
i hope it will help someone else <3

2 Likes

transformed into a wiki article: Platformio - NixOS Wiki

2 Likes