From 02146a53445889d31c75151c60066cbef36891cb Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 2 Jul 2024 04:14:28 -0400 Subject: feat: add build shell this will allow compiling the firmware using the previously packaged toolchain in an FHS environment --- firmware-build-shell.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 firmware-build-shell.nix (limited to 'firmware-build-shell.nix') diff --git a/firmware-build-shell.nix b/firmware-build-shell.nix new file mode 100644 index 0000000..83f875e --- /dev/null +++ b/firmware-build-shell.nix @@ -0,0 +1,30 @@ +{ + buildFHSEnv, + toolchain, + toolchainDir ? "opt/toolchains/crosstools-arm-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21-NPTL", +}: +(buildFHSEnv { + name = "firmware-build-env"; + + targetPkgs = + pkgs: + [ + pkgs.gcc + + # undocumented deps + pkgs.libuuid + pkgs.lzo + ] + ++ pkgs.linux.nativeBuildInputs; + + extraOutputsToInstall = [ "dev" ]; + + extraBuildCommands = '' + mkdir -p ${toolchainDir} + ln -s ${toolchain} ${toolchainDir}/usr + ''; + + profile = '' + export PATH=/${toolchainDir}/usr/bin:"$PATH" + ''; +}).env -- cgit v1.2.3