Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions firmware-build-shell.nix
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
);
in
{
devShells = forAllSystems (
system:
let
pkgs = nixpkgsFor.${system}.native;
in
{
firmware-build = pkgs.callPackage ./firmware-build-shell.nix {
toolchain = self.packages.${system}.default;
};
}
);

formatter = forAllSystems (system: nixpkgsFor.${system}.native.nixfmt-rfc-style);

packages = forAllSystems (
Expand Down