Last active
October 18, 2025 19:52
-
-
Save bachp/11708272d87097cd9ccce1726a69ffbc to your computer and use it in GitHub Desktop.
Yocto builds in using Nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { pkgs ? import <nixpkgs> {} }: | |
| with pkgs; | |
| let | |
| # Create a version of GCC without hardening flags as the hardening flags fail with yocot tries to compile gcc itself | |
| wrapCCUnhard = wrapCCWith stdenv.cc.libc ''echo "#HACK Hardening disabled by removing all flags" > $out/nix-support/add-hardening.sh''; | |
| gcc6unhard = lowPrio (wrapCCUnhard gcc6.cc); | |
| in | |
| (pkgs.buildFHSUserEnv { | |
| name = "yocto-env"; | |
| # Packages Yocto is expecting on the host system by default | |
| targetPkgs = pkgs: (with pkgs; [ which gcc6unhard glibc gnumake python3 python27 gawk wget gitFull diffstat diffutils unzip texinfo bzip2 gzip perl patch chrpath file bash cpio utillinux nettools iproute procps openssh ]); | |
| # Headers are required to build | |
| extraOutputsToInstall = [ "dev" ]; | |
| multiPkgs = pkgs: (with pkgs; []); | |
| #runScript = "bash"; | |
| }).env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment