{ pov, config, lib, ... }: let inherit (lib) types; cfg = lib.getAttrFromPath pov config; in { option = { type = types.nullOr ( lib.types.enum [ "uefi" "legacy" ] ); default = null; }; config = lib.mkIf cfg.enable ( lib.mkMerge [ (lib.mkIf (cfg.type == "legacy") { boot.loader.grub = { enable = true; inherit (cfg) configurationLimit; }; }) (lib.mkIf (cfg.type == "uefi") { boot.loader = { grub.enable = false; efi = { canTouchEfiVariables = true; efiSysMountPoint = "/boot"; }; }; }) ] ); }