{ 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 = { timeout = 0; } // (if config.bootMode == "uefi" then { efi.canTouchEfiVariables = true; systemd-boot.enable = true; } else { grub.enable = true; grub.device = "/dev/sda"; }); }; }