Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Created January 24, 2021 03:17
Show Gist options
  • Save cleverca22/54185973f524ae8196ca02db099cca16 to your computer and use it in GitHub Desktop.
Save cleverca22/54185973f524ae8196ca02db099cca16 to your computer and use it in GitHub Desktop.
[clever@amd-nixos:~/apps/rpi/pico/pico-examples]$ nix-shell
[nix-shell:~/apps/rpi/pico/pico-examples]$ mkdir build
[nix-shell:~/apps/rpi/pico/pico-examples]$ cd build
[nix-shell:~/apps/rpi/pico/pico-examples/build]$ cmake ..
CMake Warning at /nix/store/iakf0a4wi5al3a6gngf70arkmwcz7il1-source/src/rp2_common/tinyusb/CMakeLists.txt:10 (message):
TinyUSB submodule has not been initialized; USB support will be unavailable
hint: try 'git submodule update --init'.
Skipping TinyUSB device examples, as TinyUSB unavailable
Skipping TinyUSB host examples, as TinyUSB unavailable
[nix-shell:~/apps/rpi/pico/pico-examples/build]$ make -j8
[nix-shell:~/apps/rpi/pico/pico-examples/build]$ ls -lh blink/blink.uf2
-rw-r--r-- 1 clever users 28K Jan 23 23:15 blink/blink.uf2
let
pkgs = import <nixpkgs> {};
sdk = pkgs.fetchFromGitHub {
owner = "raspberrypi";
repo = "pico-sdk";
rev = "ef38b746efaeb0aa1354406198a76da29302aada";
sha256 = "sha256-G4LJfNEV68WJeiKgyOn6fpx67p7JZnwlrjEpCzrL6ac=";
};
in pkgs.callPackage ({cmake, stdenv, python3, pkgsCross }:
stdenv.mkDerivation {
name = "shell";
nativeBuildInputs = [ cmake python3 pkgsCross.arm-embedded.stdenv.cc ];
PICO_SDK_PATH = sdk;
}) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment