summaryrefslogtreecommitdiff
path: root/firmware-build-shell.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2024-07-02 04:14:28 -0400
committerseth <[email protected]>2024-07-02 04:14:28 -0400
commit02146a53445889d31c75151c60066cbef36891cb (patch)
tree1ff0f8f24a9d1edcadf051db6a06814bb921cd76 /firmware-build-shell.nix
parent24d92030dda5bbe03542e0bae51c8810f3a48548 (diff)
feat: add build shellbuild-shell
this will allow compiling the firmware using the previously packaged toolchain in an FHS environment
Diffstat (limited to 'firmware-build-shell.nix')
-rw-r--r--firmware-build-shell.nix30
1 files changed, 30 insertions, 0 deletions
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