fix(boot): pin eMMC initrd modules in configuration.nix (survive hw-config regen)

Installed initrd lacked mmc_block -> can't mount root on eMMC -> no boot.
generate-config runs in the RAM installer and misses mmc modules, and it
overwrites hardware-configuration.nix, so pin them where they merge instead.
This commit is contained in:
erik
2026-07-12 22:40:59 +02:00
parent 7200ab5836
commit d105aa5908
2 changed files with 14 additions and 22 deletions
+5
View File
@@ -14,6 +14,11 @@
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Root lives on the ZimaBlade eMMC (mmcblk0). nixos-generate-config runs in
# the RAM installer and does NOT detect these, so pin them here (merged with
# hardware-configuration.nix) or stage-1 can't mount root and the box panics.
boot.initrd.availableKernelModules = [ "mmc_block" "sdhci_pci" "sdhci_acpi" ];
# ---- NAS data array ----
# Existing ext4 on the mdadm RAID0 over sda+sdb (md0, 29.1T).
# Mounted, NOT formatted; kept out of disko so it is never wiped.
+9 -22
View File
@@ -1,31 +1,18 @@
# PLACEHOLDER — replace on the real machine.
#
# disko (disk-config.nix) owns the OS-disk filesystems, so this file should
# only carry kernel modules + platform. Get the real values from the target:
#
# # during install, or via nixos-anywhere --generate-hardware-config:
# sudo nixos-generate-config --no-filesystems --root /mnt
#
# `--no-filesystems` omits the fileSystems.* blocks (disko provides them).
# Copy the generated file over this one. Keep the imports/kernel-module lines.
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
# Incl. eMMC/SD modules — root is on the ZimaBlade eMMC, initrd must mount it.
boot.initrd.availableKernelModules = [
"xhci_pci" "ahci" "usbhid" "sd_mod"
"sdhci_pci" "sdhci_acpi" "mmc_block" # eMMC (mmcblk0)
];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# NO fileSystems here — disko defines "/" and "/boot" (see disk-config.nix).
# The NAS data mount lives in configuration.nix.
swapDevices = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}