{ pkgs ? import <nixpkgs> { }, }:
let
- cc = pkgs.pkgsCross.arm-embedded.stdenv.cc;
+
tattlekey = { lib, stdenv, cmake, pico-sdk, python3 }:
stdenv.mkDerivation {
pname = "tattlekey";
src = lib.cleanSource ./.;
nativeBuildInputs = [ cmake python3 ];
cmakeFlags = [
- "-DCMAKE_C_COMPILER=${cc}/bin/arm-none-eabi-cc"
- "-DCMAKE_CXX_COMPILER=${cc}/bin/arm-none-eabi-c++"
+ "-DCMAKE_C_COMPILER=/usr/bin/arm-none-eabi-gcc"
+ "-DCMAKE_CXX_COMPILER=/usr/bin/arm-none-eabi-c++"
"-DPICO_BOARD=pico_w"
"-DPICO_SDK_PATH=${pico-sdk}/lib/pico-sdk"
- "-DPICO_TOOLCHAIN_PATH=${cc}/bin"
];
+ diskImage = debImage;
+ diskImageFormat = "qcow2";
};
pico-sdk = pkgs.pico-sdk.overrideAttrs (old: rec {
};
});
-in pkgs.callPackage tattlekey { inherit pico-sdk; }
+ distro = "debian11x86_64";
+
+ extraPackages = [
+ "build-essential"
+ "cmake"
+ "gcc-arm-none-eabi"
+ "libnewlib-arm-none-eabi"
+ "libstdc++-arm-none-eabi-newlib"
+ ];
+
+ debImage = pkgs.vmTools.diskImageFuns."${distro}" { inherit extraPackages; };
+
+in pkgs.vmTools.runInLinuxImage
+(pkgs.callPackage tattlekey { pico-sdk = pico-sdk; })