summaryrefslogtreecommitdiff
path: root/firmware-build-shell.nix
diff options
context:
space:
mode:
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