2023-11-09 03:55:14 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-17 07:17:12 +00:00
|
|
|
}: let
|
2024-06-15 17:17:50 +00:00
|
|
|
cfg = config.my.boot;
|
2023-11-17 07:17:12 +00:00
|
|
|
in {
|
2023-11-09 03:55:14 +00:00
|
|
|
options = {
|
2024-06-15 17:17:50 +00:00
|
|
|
my.boot = {
|
|
|
|
silentBoot = lib.mkEnableOption "silent boot";
|
|
|
|
noLoaderMenu = lib.mkEnableOption "" // {description = "Whether to disable bootloader menu.";};
|
2023-09-19 00:17:43 +00:00
|
|
|
};
|
|
|
|
};
|
2023-11-09 03:55:14 +00:00
|
|
|
|
2023-11-17 07:17:12 +00:00
|
|
|
config = {
|
|
|
|
### cfg.noLoaderMenu
|
|
|
|
boot.loader.timeout = lib.mkIf cfg.noLoaderMenu 0;
|
2023-11-09 03:55:14 +00:00
|
|
|
|
2023-11-17 07:17:12 +00:00
|
|
|
### cfg.silentBoot
|
|
|
|
boot.consoleLogLevel = lib.mkIf cfg.silentBoot 0;
|
|
|
|
boot.kernelParams =
|
|
|
|
lib.mkIf cfg.silentBoot
|
|
|
|
(["quiet"]
|
|
|
|
++ lib.optionals config.boot.initrd.systemd.enable [
|
|
|
|
"systemd.show_status=auto"
|
|
|
|
"rd.udev.log_level=3"
|
|
|
|
]);
|
2023-11-09 03:55:14 +00:00
|
|
|
};
|
2023-09-19 00:17:43 +00:00
|
|
|
}
|