]>
Commit | Line | Data |
---|---|---|
9e450553 | 1 | { pkgs ? import <nixpkgs> { }, }: |
5ec2b60a SW |
2 | let |
3 | cc = pkgs.pkgsCross.arm-embedded.stdenv.cc; | |
4 | tattlekey = { lib, stdenv, cmake, pico-sdk, python3 }: | |
5 | stdenv.mkDerivation { | |
6 | pname = "tattlekey"; | |
7 | version = "0.0.1"; | |
8 | src = lib.cleanSource ./.; | |
9 | nativeBuildInputs = [ cmake python3 ]; | |
10 | cmakeFlags = [ | |
11 | "-DCMAKE_C_COMPILER=${cc}/bin/arm-none-eabi-cc" | |
12 | "-DCMAKE_CXX_COMPILER=${cc}/bin/arm-none-eabi-c++" | |
e2173399 | 13 | "-DPICO_BOARD=pico_w" |
9e450553 | 14 | "-DPICO_SDK_PATH=${pico-sdk}/lib/pico-sdk" |
5ec2b60a SW |
15 | "-DPICO_TOOLCHAIN_PATH=${cc}/bin" |
16 | ]; | |
5ec2b60a | 17 | }; |
9e450553 SW |
18 | |
19 | pico-sdk = pkgs.pico-sdk.overrideAttrs (old: rec { | |
20 | version = "1.5.1"; | |
21 | src = pkgs.fetchFromGitHub { | |
22 | fetchSubmodules = true; | |
23 | owner = "raspberrypi"; | |
24 | repo = "pico-sdk"; | |
25 | rev = version; | |
26 | hash = "sha256-GY5jjJzaENL3ftuU5KpEZAmEZgyFRtLwGVg3W1e/4Ho="; | |
27 | }; | |
28 | }); | |
29 | ||
30 | in pkgs.callPackage tattlekey { inherit pico-sdk; } |