From 1a8a6b8d6dba613e67c956de5274b1af925d0908 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Mon, 6 Apr 2026 14:16:25 -0700 Subject: [PATCH] fix: slim initrd + smaller image for fast USB boot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Set includeDefaultModules=false — only load Intel laptop + USB boot modules instead of every driver. Drops initrd from 1.4GB to ~50-80MB. - Reduce additionalSpace from 2G to 256M (read-only kiosk). - Should cut loader time from 55s to ~5s on USB2. Co-Authored-By: Claude Opus 4.6 (1M context) --- fedac/nixos/flake.nix | 2 +- fedac/nixos/modules/hardware.nix | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fedac/nixos/flake.nix b/fedac/nixos/flake.nix index 6bd84438e5..70f6f65c96 100644 --- a/fedac/nixos/flake.nix +++ b/fedac/nixos/flake.nix @@ -71,7 +71,7 @@ # enough room for the kernel, initrd, and GRUB assets. bootSize = "2048M"; diskSize = "auto"; - additionalSpace = "2G"; + additionalSpace = "256M"; memSize = 4096; }; diff --git a/fedac/nixos/modules/hardware.nix b/fedac/nixos/modules/hardware.nix index 64ecf82940..e52762d824 100644 --- a/fedac/nixos/modules/hardware.nix +++ b/fedac/nixos/modules/hardware.nix @@ -18,9 +18,11 @@ security.rtkit.enable = true; services.pipewire.enable = false; - # Kernel modules for common hardware + # Slim initrd — only modules needed for Intel laptops + USB boot. + # Default NixOS initrd is 1.4GB (every driver); this cuts to ~50-80MB. + boot.initrd.includeDefaultModules = false; boot.initrd.availableKernelModules = [ - # Storage + # Storage (USB boot + internal NVMe) "ahci" "nvme" "sd_mod" "usb_storage" "uas" "xhci_pci" "ehci_pci" "ohci_pci" # Input @@ -28,7 +30,7 @@ # GPU (loaded early for KMS) "i915" "amdgpu" "nouveau" # Filesystems - "vfat" "nls_cp437" "nls_iso8859_1" + "ext4" "vfat" "nls_cp437" "nls_iso8859_1" ]; boot.kernelModules = [ -- 2.51.2