{ config, lib, ... }: let inherit (lib) mkOption types; in { options.bootMode = mkOption { type = types.enum [ "uefi" "legacy" ]; default = "uefi"; }; config = { boot.consoleLogLevel = 0; boot.kernelParams = [ "quiet" "udev.log_level=3" ]; boot.loader = if config.bootMode == "uefi" then { efi.canTouchEfiVariables = true; systemd-boot.enable = true; timeout = 0; } else { grub.enable = true; grub.device = "/dev/sda"; timeout = 0; }; }; }