cryodev/hosts/cryodev-pi/sd-image.nix
steffen 2155f4073f
Some checks failed
CI / flake-check (pull_request) Successful in 31s
CI / build-hosts (pull_request) Failing after 1m23s
fix Pi build: force initrd modules to exclude x86 hardware
sd-image.nix imports all-hardware.nix which adds modules like dw-hdmi
that don't exist in the RPi4 kernel. mkForce the availableKernelModules
list to only include Pi-relevant modules.
2026-03-14 15:04:29 +01:00

38 lines
807 B
Nix

# SD Card image configuration for Raspberry Pi
{
config,
modulesPath,
lib,
...
}:
{
imports = [
(modulesPath + "/installer/sd-card/sd-image-aarch64.nix")
];
sdImage = {
# Compress with zstd for smaller download
compressImage = true;
# Auto-expand root partition on first boot
expandOnBoot = true;
};
# Image filename based on hostname
image.fileName = "${config.networking.hostName}-sd-image.img";
# Disable ZFS to avoid build issues on SD image
boot.supportedFilesystems = lib.mkForce [
"vfat"
"ext4"
];
# sd-image.nix imports all-hardware.nix which adds x86 modules like dw-hdmi
# that don't exist in the RPi4 kernel. Filter them out.
boot.initrd.availableKernelModules = lib.mkForce [
"xhci_pci"
"usbhid"
"usb_storage"
];
}