Emulate ARM systems for building

This commit is contained in:
Zuckerberg 2024-01-30 21:59:09 -07:00
parent ba3d15d82a
commit b5cc4d4609
3 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,57 @@
{ config, modulesPath, pkgs, lib, ... }:
let
pinecube-uboot = pkgs.buildUBoot {
defconfig = "pinecube_defconfig";
extraMeta.platforms = [ "armv7l-linux" ];
filesToInstall = [ "u-boot-sunxi-with-spl.bin" ];
};
in
{
imports = [
(modulesPath + "/installer/sd-card/sd-image.nix")
./minimal.nix
];
sdImage.populateFirmwareCommands = "";
sdImage.populateRootCommands = ''
mkdir -p ./files/boot
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot
'';
sdImage.postBuildCommands = ''
dd if=${pinecube-uboot}/u-boot-sunxi-with-spl.bin of=$img bs=1024 seek=8 conv=notrunc
'';
###
networking.hostName = "pinecube";
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
boot.consoleLogLevel = 7;
# cma is 64M by default which is waay too much and we can't even unpack initrd
boot.kernelParams = [ "console=ttyS0,115200n8" "cma=32M" ];
boot.kernelModules = [ "spi-nor" ]; # Not sure why this doesn't autoload. Provides SPI NOR at /dev/mtd0
boot.extraModulePackages = [ config.boot.kernelPackages.rtl8189es ];
zramSwap.enable = true; # 128MB is not much to work with
sound.enable = true;
environment.systemPackages = with pkgs; [
ffmpeg
(v4l_utils.override { withGUI = false; })
usbutils
];
services.getty.autologinUser = lib.mkForce "googlebot";
users.users.googlebot = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "video" ];
openssh.authorizedKeys.keys = config.machines.ssh.userKeys;
};
networking.wireless.enable = true;
}

View File

@ -220,4 +220,6 @@
enable = true; enable = true;
configFile = ./dashy.yaml; configFile = ./dashy.yaml;
}; };
boot.binfmt.emulatedSystems = [ "aarch64-linux" "armv7l-linux" ];
} }

View File

@ -0,0 +1,16 @@
age-encryption.org/v1
-> ssh-ed25519 WBT1Hw 5DKa7UCodZLyTIBKfBurEXZsK6o/GfiggzgraB4YVik
UNcoa5/uljUc/bBpDWSXOVba3/oxZDdG16gDK1aegVw
-> ssh-ed25519 6AT2/g JkNLSQpug+kH9FXD/BO4Fqsoja8SmPE0xtEvUty+whE
xL3RsDOvk0S1dGi9eQ2p3nhiNo3gFarJyMghM/clu1I
-> ssh-ed25519 hPp1nw Jga9cT/t5CswxmKL90fQjjpdAwCZmOwAjHZk+9LDHEQ
AmS4gOWCCrxFEySjFcXR0Iia2WPlfV1jL6OTwRZu2r4
-> ssh-ed25519 dMQYog C3TYIrNoQFBm45WlJ5wNIBeZzHMuM3G7qK1nXULKNFk
R1Uv2EoLcOmYcFcQKhbdDz3U8v2Vg5FcBjNhUNTtvlc
-> n5zi-V*C-grease & As33LE` ~p3'Jct
ADAGI5OX7hStwDlR21y7Qcmmw+AuHAfGK6AU3rz9xGSoSh36zQ
--- fwM6RC7rdlwP4YkWIBYjh7YdZSbGIhHtX/9WFmvGAKI
T†6èV÷eBàÚÉ¡9õ
¨¦pàÚ*…C¯ÿò!ï„?¬À©´ šc ýÕ3ªÉ ^ë<
X&òV¢¼ûõþ·?]5>
F]qŠú :È>3@J-N”`ËŠê±××­v°î|÷Ç3NO”±:ªŠ 9