nixpkgs/nixos/modules/system/boot/extra-initrd.nix
r-vdp 5f267f4dda nixos/boot: allow passing extra initrd archives to the bootloader
This is for instance useful on Asahi where an additional initrd archive
containing firmware blobs and per-device calibration files is placed
on the ESP and updated by the Asahi Linux Installer.
These need to be loaded alongside the NixOS initrd.

Implemented for systemd-boot and Limine. Grub is left out since its
install script does not use bootspec yet.

Co-authored-by: Florian Klink <flokli@flokli.de>
2026-06-26 13:39:08 +03:00

21 lines
549 B
Nix

{ config, lib, ... }:
{
options.system.boot.extraInitrd = {
paths = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ ];
description = ''
List of paths relative to the ESP that are combined with the NixOS
main initrd before being passed to the kernel.
'';
};
};
config = {
boot.bootspec.extensions = lib.mkIf (config.system.boot.extraInitrd.paths != [ ]) {
"org.nixos.extra-initrd.v1" = {
inherit (config.system.boot.extraInitrd) paths;
};
};
};
}