{ pkgs, lib, config, ... }: { options.mods = { boot.enable = lib.mkEnableOption { description = "enables grub"; default = true; }; }; config = lib.mkIf config.mods.boot.enable { boot.loader = lib.mkIf config.mods.xorg.enable { timeout = 2; efi.canTouchEfiVariables = true; grub = { enable = lib.mkDefault true; zfsSupport = true; efiSupport = true; device = "nodev"; } // lib.optionalAttrs (config.mods.monitors != { }) { gfxmodeEfi = config.mods.monitors.primary.config.mode; }; }; }; }