From 8655eb017b9424d39740c87c322cb0df11302f39 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Fri, 29 Sep 2023 14:39:32 -0700 Subject: [PATCH] client: Get lwipopts.h from pico-examples --- client/default.nix | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/client/default.nix b/client/default.nix index a2bbf91..eb65f49 100644 --- a/client/default.nix +++ b/client/default.nix @@ -1,12 +1,16 @@ { pkgs ? import { }, }: let - tattlekey = { lib, stdenv, cmake, pico-sdk, python3 }: + tattlekey = { lib, stdenv, cmake, pico-sdk, pico-examples, python3 }: stdenv.mkDerivation { pname = "tattlekey"; version = "0.0.1"; src = lib.cleanSource ./.; nativeBuildInputs = [ cmake python3 ]; + postUnpack = '' + # Per https://datasheets.raspberrypi.com/picow/connecting-to-the-internet-with-pico-w.pdf page 9 + cp ${pico-examples}/pico_w/wifi/lwipopts_examples_common.h lwipopts.h + ''; cmakeFlags = [ "-DCMAKE_C_COMPILER=/usr/bin/arm-none-eabi-gcc" "-DCMAKE_CXX_COMPILER=/usr/bin/arm-none-eabi-c++" @@ -17,17 +21,27 @@ let diskImageFormat = "qcow2"; }; - pico-sdk = pkgs.pico-sdk.overrideAttrs (old: rec { - version = "1.5.1"; + pico-sdk-version = "1.5.1"; + + pico-sdk = pkgs.pico-sdk.overrideAttrs (old: { + version = pico-sdk-version; src = pkgs.fetchFromGitHub { fetchSubmodules = true; owner = "raspberrypi"; repo = "pico-sdk"; - rev = version; + rev = pico-sdk-version; hash = "sha256-GY5jjJzaENL3ftuU5KpEZAmEZgyFRtLwGVg3W1e/4Ho="; }; }); + pico-examples = pkgs.fetchFromGitHub { + fetchSubmodules = true; + owner = "raspberrypi"; + repo = "pico-examples"; + rev = "sdk-${pico-sdk-version}"; + hash = "sha256-mJIOWUqsQJcg7FUWZePf+pA/YblZskDtIVnUJiz7szU="; + }; + distro = "debian11x86_64"; extraPackages = [ @@ -41,4 +55,4 @@ let debImage = pkgs.vmTools.diskImageFuns."${distro}" { inherit extraPackages; }; in pkgs.vmTools.runInLinuxImage -(pkgs.callPackage tattlekey { pico-sdk = pico-sdk; }) +(pkgs.callPackage tattlekey { inherit pico-examples pico-sdk; }) -- 2.44.1