boot.initrd.extraFiles: allow users to add arbitrary files to the initrd

This commit is contained in:
Graham Christensen 2021-10-05 14:38:49 -04:00 committed by Michael Brantley
parent ef1e6f5526
commit 829bbc708b

View File

@ -338,7 +338,14 @@ let
{ object = pkgs.kmod-debian-aliases;
symlink = "/etc/modprobe.d/debian.conf";
}
];
] ++ (lib.mapAttrsToList
(symlink: options:
{
inherit symlink;
object = options.source;
}
)
config.boot.initrd.extraFiles);
};
# Script to add secret files to the initrd at bootloader update time
@ -419,6 +426,22 @@ in
'';
};
boot.initrd.extraFiles = mkOption {
default = { };
type = types.attrsOf
(types.submodule {
options = {
source = mkOption {
type = types.package;
description = "The object to make available inside the initrd.";
};
};
});
description = ''
Extra files to link and copy in to the initrd.
'';
};
boot.initrd.prepend = mkOption {
default = [ ];
type = types.listOf types.str;