1 { pkgs ? import <nixpkgs> { }, }:
4 tattlekey = { lib, stdenv, cmake, pico-sdk, pico-examples, python3 }:
8 src = lib.cleanSource ./.;
9 nativeBuildInputs = [ cmake python3 ];
11 # Per https://datasheets.raspberrypi.com/picow/connecting-to-the-internet-with-pico-w.pdf page 9
12 cp ${pico-examples}/pico_w/wifi/lwipopts_examples_common.h lwipopts.h
15 "-DCMAKE_C_COMPILER=/usr/bin/arm-none-eabi-gcc"
16 "-DCMAKE_CXX_COMPILER=/usr/bin/arm-none-eabi-c++"
18 "-DPICO_SDK_PATH=${pico-sdk}/lib/pico-sdk"
21 diskImageFormat = "qcow2";
24 pico-sdk-version = "1.5.1";
26 pico-sdk = pkgs.pico-sdk.overrideAttrs (old: {
27 version = pico-sdk-version;
28 src = pkgs.fetchFromGitHub {
29 fetchSubmodules = true;
30 owner = "raspberrypi";
32 rev = pico-sdk-version;
33 hash = "sha256-GY5jjJzaENL3ftuU5KpEZAmEZgyFRtLwGVg3W1e/4Ho=";
37 pico-examples = pkgs.fetchFromGitHub {
38 fetchSubmodules = true;
39 owner = "raspberrypi";
40 repo = "pico-examples";
41 rev = "sdk-${pico-sdk-version}";
42 hash = "sha256-mJIOWUqsQJcg7FUWZePf+pA/YblZskDtIVnUJiz7szU=";
45 distro = "debian11x86_64";
51 "libnewlib-arm-none-eabi"
52 "libstdc++-arm-none-eabi-newlib"
55 debImage = pkgs.vmTools.diskImageFuns."${distro}" { inherit extraPackages; };
57 in pkgs.vmTools.runInLinuxImage
58 (pkgs.callPackage tattlekey { inherit pico-examples pico-sdk; })