-{ pkgs ? import ~/devel/nixpkgs { }, }:
+{ pkgs ? import <nixpkgs> { }, }:
let
cc = pkgs.pkgsCross.arm-embedded.stdenv.cc;
tattlekey = { lib, stdenv, cmake, pico-sdk, python3 }:
cmakeFlags = [
"-DCMAKE_C_COMPILER=${cc}/bin/arm-none-eabi-cc"
"-DCMAKE_CXX_COMPILER=${cc}/bin/arm-none-eabi-c++"
- "-DPICO_SDK_PATH=${pico-sdk.override { minimal = false; }}/lib/pico-sdk"
+ "-DPICO_BOARD=pico_w"
+ "-DPICO_SDK_PATH=${pico-sdk}/lib/pico-sdk"
"-DPICO_TOOLCHAIN_PATH=${cc}/bin"
];
- /*
- installPhase = ''
- runHook preInstall
-
- mkdir $out
- mv build/tattlekey.* $out
+ };
- runHook postInstall
- '';
- */
+ pico-sdk = pkgs.pico-sdk.overrideAttrs (old: rec {
+ version = "1.5.1";
+ src = pkgs.fetchFromGitHub {
+ fetchSubmodules = true;
+ owner = "raspberrypi";
+ repo = "pico-sdk";
+ rev = version;
+ hash = "sha256-GY5jjJzaENL3ftuU5KpEZAmEZgyFRtLwGVg3W1e/4Ho=";
};
-in pkgs.callPackage tattlekey {}
+ });
+
+in pkgs.callPackage tattlekey { inherit pico-sdk; }