flake/nixos/modules/boot/boot.nix

44 lines
1,006 B
Nix
Raw Normal View History

{
config,
lib,
...
}: let
cfg = config.myFlake.nixos.boot;
in {
options = {
myFlake.nixos = {
boot = {
silentBoot = lib.mkEnableOption "Whether to enable silent boot.";
noLoaderMenu = lib.mkEnableOption "Whether to disable bootloader menu.";
2023-09-19 00:17:43 +00:00
};
};
};
config = {
### cfg.noLoaderMenu
boot.loader.timeout = lib.mkIf cfg.noLoaderMenu 0;
### 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"
]);
### Misc
boot.loader = {
efi.canTouchEfiVariables = true;
systemd-boot = {
enable = lib.mkDefault true; # mkDefault for Lanzaboote
editor = false; # Disabled for security
### Utilities
#netbootxyz.enable = true;
#memtest86.enable = true;
};
};
};
2023-09-19 00:17:43 +00:00
}