Created
August 25, 2020 14:13
-
-
Save sorki/548de08f621b066c94f0c36a7a78cc41 to your computer and use it in GitHub Desktop.
rpi cross
This file contains 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
{ config, lib, pkgs, ... }: | |
{ | |
imports = [ | |
<nixpkgs/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix> | |
]; | |
nixpkgs = { | |
crossSystem.system = "armv7l-linux"; | |
}; | |
# closure minification | |
environment.noXlibs = true; | |
services.xserver.enable = false; | |
services.xserver.desktopManager.xterm.enable = lib.mkForce false; | |
# this pulls too much graphical stuff | |
services.udisks2.enable = lib.mkForce false; | |
# this pulls spidermonkey and firefox | |
security.polkit.enable = false; | |
boot.supportedFilesystems = lib.mkForce [ "vfat" ]; | |
i18n.supportedLocales = lib.mkForce [ (config.i18n.defaultLocale + "/UTF-8") ]; | |
documentation.enable = false; | |
documentation.nixos.enable = false; | |
} |
This file contains 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
export NIX_PATH=nixpkgs=/home/jane/local_nixpkgs_checkout | |
nix-build --cores 0 '<nixpkgs/nixos>' \ | |
-I nixos-config=configuration.nix \ | |
-A config.system.build.sdImage \ | |
-o result-cross \ | |
--keep-going |
Interesting. IIRC that Aarch64 can't be used for my specific RPI hardware. It'd be nice if hydra could help us with the cross builds - see NixOS/mobile-nixos#197
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This minimal image takes reasonable amount of time to build on 8 core machine (like ~4 hours from scratch). You already get some things from official
cache.nixos.org
thanks tonixos-mobile
using the cross tooling. How much is cached also depends on nixpkgs commit you pick.The ones listed on the wiki are only useful for native / QEMU builds since with cross compilation you end up with different Nix store paths. That means you currently cannot interchange native and cross built packages - you might need to install the ones listed on the wiki iff you want to
nixos-rebuild
cross-built image on the target (I usually don't build anything on rPIs, just push cross-built closures from x86 or another bit more powerful armv7 builder).