mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
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>
21 lines
549 B
Nix
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;
|
|
};
|
|
};
|
|
};
|
|
}
|