├── readme.md └── flake.nix /readme.md: -------------------------------------------------------------------------------- 1 | # buildroot_flake 2 | 3 | Simple flake builds buildroot projects on nixos. 4 | 5 | Buildroot hardcodes `/usr/bin/` paths, which is why this project uses 6 | a `FHSuserEnv` instead of a basic `mkShell`. 7 | 8 | The cross toolchain used is `AARCH64` but can be modified for other 9 | architectures by modifying the `pkgsCross` path to the cross compiling gcc. 10 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Example flake environment for build buildroot projects"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 | }; 7 | 8 | outputs = inputs@{ flake-parts, ... }: 9 | flake-parts.lib.mkFlake { inherit inputs; } { 10 | imports = [ ]; 11 | systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; 12 | perSystem = { config, self', inputs', pkgs, system, ... }: { 13 | devShells.default = (pkgs.buildFHSUserEnv { 14 | name = "buildroot"; 15 | targetPkgs = pkgs: (with pkgs; 16 | [ 17 | (lib.hiPrio gcc) 18 | file 19 | gnumake 20 | ncurses.dev 21 | pkg-config 22 | unzip 23 | wget 24 | pkgsCross.aarch64-multiplatform.gccStdenv.cc 25 | ] ++ pkgs.linux.nativeBuildInputs); 26 | }).env; 27 | }; 28 | flake = { 29 | }; 30 | }; 31 | } 32 | --------------------------------------------------------------------------------